aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2017-07-07 14:57:50 +0800
committerJames McCoy <jamessan@jamessan.com>2017-07-13 23:09:03 -0400
commit04de6a64e2f7b3b235acd4ab779bfed30e59451f (patch)
treedfaed4439bfd21febf94e05e9c8d0a703f528dbe /src/nvim/testdir
parentf746e38955f33dfdcc0dbdb40efaae82fb4b4c12 (diff)
downloadrneovim-04de6a64e2f7b3b235acd4ab779bfed30e59451f.tar.gz
rneovim-04de6a64e2f7b3b235acd4ab779bfed30e59451f.tar.bz2
rneovim-04de6a64e2f7b3b235acd4ab779bfed30e59451f.zip
vim-patch:7.4.2189
https://github.com/vim/vim/commit/f71d7b9ee5ceba75f70c30845332ddd728fd16c6 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 9 22:14:05 2016 +0200 patch 7.4.2189 Problem: Cannot detect encoding in a fifo. Solution: Extend the stdin way of detecting encoding to fifo. Add a test for detecting encoding on stdin and fifo. (Ken Takata)
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/Makefile2
-rw-r--r--src/nvim/testdir/test_startup.vim2
-rw-r--r--src/nvim/testdir/test_startup_utf8.vim64
3 files changed, 67 insertions, 1 deletions
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index 7e55fffa06..510e8820f4 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -62,6 +62,8 @@ NEW_TESTS ?= \
test_signs.res \
test_smartindent.res \
test_stat.res \
+ test_startup.res \
+ test_startup_utf8.res \
test_substitute.res \
test_syntax.res \
test_tabpage.res \
diff --git a/src/nvim/testdir/test_startup.vim b/src/nvim/testdir/test_startup.vim
index 5996b2cd4a..64f7f31294 100644
--- a/src/nvim/testdir/test_startup.vim
+++ b/src/nvim/testdir/test_startup.vim
@@ -75,7 +75,7 @@ func Test_help_arg()
" check if couple of lines are there
let found = []
for line in lines
- if line =~ '-R.*Readonly mode'
+ if line =~ '-R.*Read-only mode'
call add(found, 'Readonly mode')
endif
" Watch out for a second --version line in the Gnome version.
diff --git a/src/nvim/testdir/test_startup_utf8.vim b/src/nvim/testdir/test_startup_utf8.vim
new file mode 100644
index 0000000000..d179a4cc79
--- /dev/null
+++ b/src/nvim/testdir/test_startup_utf8.vim
@@ -0,0 +1,64 @@
+" Tests for startup using utf-8.
+if !has('multi_byte')
+ finish
+endif
+
+source shared.vim
+
+func Test_read_stdin_utf8()
+ let linesin = ['テスト', '€ÀÈÌÒÙ']
+ call writefile(linesin, 'Xtestin')
+ let before = [
+ \ 'set enc=utf-8',
+ \ 'set fencs=cp932,utf-8',
+ \ ]
+ let after = [
+ \ 'write ++enc=utf-8 Xtestout',
+ \ 'quit!',
+ \ ]
+ if has('win32')
+ let pipecmd = 'type Xtestin | '
+ else
+ let pipecmd = 'cat Xtestin | '
+ endif
+ if RunVimPiped(before, after, '-', pipecmd)
+ let lines = readfile('Xtestout')
+ call assert_equal(linesin, lines)
+ else
+ call assert_equal('', 'RunVimPiped failed.')
+ endif
+ call delete('Xtestout')
+ call delete('Xtestin')
+endfunc
+
+func Test_read_fifo_utf8()
+ if !has('unix')
+ return
+ endif
+ " Using bash/zsh's process substitution.
+ if executable('bash')
+ set shell=bash
+ elseif executable('zsh')
+ set shell=zsh
+ else
+ return
+ endif
+ let linesin = ['テスト', '€ÀÈÌÒÙ']
+ call writefile(linesin, 'Xtestin')
+ let before = [
+ \ 'set enc=utf-8',
+ \ 'set fencs=cp932,utf-8',
+ \ ]
+ let after = [
+ \ 'write ++enc=utf-8 Xtestout',
+ \ 'quit!',
+ \ ]
+ if RunVim(before, after, '<(cat Xtestin)')
+ let lines = readfile('Xtestout')
+ call assert_equal(linesin, lines)
+ else
+ call assert_equal('', 'RunVim failed.')
+ endif
+ call delete('Xtestout')
+ call delete('Xtestin')
+endfunc