diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-04-01 22:38:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-01 22:38:20 +0200 |
commit | 518f28f537971c70d7781ce30c5de0c829e01464 (patch) | |
tree | 9c76363156ee48433f1f213437320b7bcf45704e /test | |
parent | 337b6179df852350b52409fd3806e4b47ab2875b (diff) | |
parent | 19690d4a25f15dfa752ac3723384f1d33f06329a (diff) | |
download | rneovim-518f28f537971c70d7781ce30c5de0c829e01464.tar.gz rneovim-518f28f537971c70d7781ce30c5de0c829e01464.tar.bz2 rneovim-518f28f537971c70d7781ce30c5de0c829e01464.zip |
Merge #6422 from ZyX-I/fix-6420
eval,fileio: Omit additional fsync() call
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/os/fileio_spec.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/os/fileio_spec.lua b/test/unit/os/fileio_spec.lua index 7a738ce85c..5e1b2523fa 100644 --- a/test/unit/os/fileio_spec.lua +++ b/test/unit/os/fileio_spec.lua @@ -80,6 +80,10 @@ local function file_read(fp, size) return ret1, ret2 end +local function file_flush(fp) + return m.file_flush(fp) +end + local function file_fsync(fp) return m.file_fsync(fp) end @@ -244,6 +248,21 @@ describe('file_fsync', function() end) end) +describe('file_flush', function() + itp('can flush writes to disk', function() + local err, fp = file_open(filec, m.kFileCreateOnly, 384) + eq(0, file_flush(fp)) + eq(0, err) + eq(0, lfs.attributes(filec).size) + local wsize = file_write(fp, 'test') + eq(4, wsize) + eq(0, lfs.attributes(filec).size) + eq(0, file_flush(fp)) + eq(wsize, lfs.attributes(filec).size) + eq(0, m.file_close(fp)) + end) +end) + describe('file_read', function() itp('can read small chunks of input until eof', function() local err, fp = file_open(file1, 0, 384) |