diff options
| author | James McCoy <jamessan@jamessan.com> | 2018-10-12 22:04:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-12 22:04:39 -0400 |
| commit | 8bbb28b9732bfa430a963f16498d8ec42c637ca9 (patch) | |
| tree | 71359d32b20f99fd7f1461f759c9b843ce04808c /src/nvim/testdir | |
| parent | 4c780d663f6ea8ab350e95a707bb98a96c4cc701 (diff) | |
| parent | aeda13cfdf80b64c48313cbe6abd2ff028431808 (diff) | |
| download | rneovim-8bbb28b9732bfa430a963f16498d8ec42c637ca9.tar.gz rneovim-8bbb28b9732bfa430a963f16498d8ec42c637ca9.tar.bz2 rneovim-8bbb28b9732bfa430a963f16498d8ec42c637ca9.zip | |
Merge pull request #8968 from ckelsel/vim-8.0.0685
[RFC] vim-patch:8.0.0685
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_writefile.vim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_writefile.vim b/src/nvim/testdir/test_writefile.vim index 06f9d03554..1cd5fb306a 100644 --- a/src/nvim/testdir/test_writefile.vim +++ b/src/nvim/testdir/test_writefile.vim @@ -32,6 +32,24 @@ func Test_writefile_fails_gently() call assert_fails('call writefile([], [])', 'E730:') endfunc +func Test_writefile_fails_conversion() + if !has('multi_byte') || !has('iconv') + return + endif + set nobackup nowritebackup + new + let contents = ["line one", "line two"] + call writefile(contents, 'Xfile') + edit Xfile + call setline(1, ["first line", "cannot convert \u010b", "third line"]) + call assert_fails('write ++enc=cp932') + call assert_equal(contents, readfile('Xfile')) + + call delete('Xfile') + bwipe! + set backup& writebackup& +endfunc + func SetFlag(timer) let g:flag = 1 endfunc |