aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-07-14 06:42:52 -0400
committerGitHub <noreply@github.com>2017-07-14 06:42:52 -0400
commitdabd9ef44bb30b403e5a13ab1b6534cef6d8d8d0 (patch)
tree5e591eaef52e4efa1e10fb2df66a59b6d7cea9c8 /src/nvim/testdir
parentc4ac3ffbef9258a615e6549d40decef96e16bd9c (diff)
parent462a6148a64f2c2faabdee1eacac273ddbbd095a (diff)
downloadrneovim-dabd9ef44bb30b403e5a13ab1b6534cef6d8d8d0.tar.gz
rneovim-dabd9ef44bb30b403e5a13ab1b6534cef6d8d8d0.tar.bz2
rneovim-dabd9ef44bb30b403e5a13ab1b6534cef6d8d8d0.zip
Merge pull request #6977 from ckelsel/_vim-7.4.2189.patch
vim-patch:7.4.2189
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