diff options
author | Josh Rahm <rahm@google.com> | 2022-08-19 12:26:08 -0600 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2022-08-19 13:06:41 -0600 |
commit | a7237662f96933efe29eed8212464571e3778cd0 (patch) | |
tree | 27930202726b4251437c8cfa53069f65b4db90dc /src/nvim/testdir/test_writefile.vim | |
parent | 02292344929069ea63c0bb872cc22d552d86b67f (diff) | |
parent | b2f979b30beac67906b2dd717fcb6a34f46f5e54 (diff) | |
download | rneovim-tmp.tar.gz rneovim-tmp.tar.bz2 rneovim-tmp.zip |
Merge branch 'master' of https://github.com/neovim/neovim into rahmtmp
Diffstat (limited to 'src/nvim/testdir/test_writefile.vim')
-rw-r--r-- | src/nvim/testdir/test_writefile.vim | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/src/nvim/testdir/test_writefile.vim b/src/nvim/testdir/test_writefile.vim index bfbba1f793..a8735bcaf1 100644 --- a/src/nvim/testdir/test_writefile.vim +++ b/src/nvim/testdir/test_writefile.vim @@ -128,6 +128,25 @@ func Test_nowrite_quit_split() bwipe Xfile endfunc +func Test_writefile_sync_arg() + " This doesn't check if fsync() works, only that the argument is accepted. + call writefile(['one'], 'Xtest', 's') + call writefile(['two'], 'Xtest', 'S') + call delete('Xtest') +endfunc + +func Test_writefile_sync_dev_stdout() + if !has('unix') + return + endif + if filewritable('/dev/stdout') + " Just check that this doesn't cause an error. + call writefile(['one'], '/dev/stdout', 's') + else + throw 'Skipped: /dev/stdout is not writable' + endif +endfunc + func Test_writefile_autowrite() set autowrite new @@ -237,29 +256,18 @@ func Test_write_errors() call delete('Xfile') endfunc -func Test_writefile_sync_dev_stdout() - if !has('unix') - return - endif - if filewritable('/dev/stdout') - " Just check that this doesn't cause an error. - call writefile(['one'], '/dev/stdout', 's') - else - throw 'Skipped: /dev/stdout is not writable' - endif -endfunc - -func Test_writefile_sync_arg() - " This doesn't check if fsync() works, only that the argument is accepted. - call writefile(['one'], 'Xtest', 's') - call writefile(['two'], 'Xtest', 'S') - call delete('Xtest') +" Test for writing a file using invalid file encoding +func Test_write_invalid_encoding() + new + call setline(1, 'abc') + call assert_fails('write ++enc=axbyc Xfile', 'E213:') + close! endfunc " Tests for reading and writing files with conversion for Win32. func Test_write_file_encoding() - CheckMSWindows throw 'skipped: Nvim does not support :w ++enc=cp1251' + CheckMSWindows let save_encoding = &encoding let save_fileencodings = &fileencodings set encoding& fileencodings& |