comparison src/testdir/test_startup.vim @ 9794:fd32f719d34f v7.4.2172

commit https://github.com/vim/vim/commit/472a0a880a709c027f4b19cfa56c08e78818112d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 6 22:31:42 2016 +0200 patch 7.4.2172 Problem: No test for "vim --help". Solution: Add a test.
author Christian Brabandt <cb@256bit.org>
date Sat, 06 Aug 2016 22:45:04 +0200
parents 3fdf6caf42f7
children 1f1ed7959860
comparison
equal deleted inserted replaced
9793:f0921034ac5e 9794:fd32f719d34f
39 call writefile(['let done = 1'], 'Xhere/pack/foo/start/foobar/plugin/foo.vim') 39 call writefile(['let done = 1'], 'Xhere/pack/foo/start/foobar/plugin/foo.vim')
40 40
41 call mkdir('Xafter/plugin', 'p') 41 call mkdir('Xafter/plugin', 'p')
42 call writefile(['let done = 1'], 'Xafter/plugin/later.vim') 42 call writefile(['let done = 1'], 'Xafter/plugin/later.vim')
43 43
44 if RunVim(before, after) 44 if RunVim(before, after, '')
45 45
46 let lines = readfile('Xtestout') 46 let lines = readfile('Xtestout')
47 let expected = ['Xbefore.vim', 'here.vim', 'foo.vim', 'later.vim', 'Xafter.vim'] 47 let expected = ['Xbefore.vim', 'here.vim', 'foo.vim', 'later.vim', 'Xafter.vim']
48 let found = [] 48 let found = []
49 for line in lines 49 for line in lines
58 58
59 call delete('Xtestout') 59 call delete('Xtestout')
60 call delete('Xhere', 'rf') 60 call delete('Xhere', 'rf')
61 call delete('Xafter', 'rf') 61 call delete('Xafter', 'rf')
62 endfunc 62 endfunc
63
64 func Test_help_arg()
65 if RunVim([], [], '--help >Xtestout')
66 let lines = readfile('Xtestout')
67 call assert_true(len(lines) > 20)
68 call assert_true(lines[0] =~ 'Vi IMproved')
69
70 " check if couple of lines are there
71 let found = 0
72 for line in lines
73 if line =~ '-R.*Readonly mode'
74 let found += 1
75 endif
76 if line =~ '--version'
77 let found += 1
78 endif
79 endfor
80 call assert_equal(2, found)
81 endif
82 call delete('Xtestout')
83 endfunc