blob: 1c3079f62f7bb408befe5c0db33954a166781063 [file] [log] [blame]
Bram Moolenaarf4c5fcb2013-07-03 17:14:00 +02001- Some tests for setting 'number' and 'relativenumber'
2 This is not all that useful now that the options are no longer reset when
3 setting the other.
4- Some tests for findfile() function
Bram Moolenaar00154502013-02-13 16:15:55 +01005
6STARTTEST
Bram Moolenaarcaca92b2013-02-14 20:10:33 +01007:so small.vim
Bram Moolenaar2ab07132013-04-24 15:47:15 +02008:set hidden nocp nu rnu viminfo+=nviminfo
Bram Moolenaar00154502013-02-13 16:15:55 +01009:redir @a | set nu? rnu? | redir END
10:e! xx
11:redir @b | set nu? rnu? | redir END
12:e! #
13:$put ='results:'
14:$put a
15:$put b
Bram Moolenaar20754022013-03-13 20:42:32 +010016:"
17:set nonu nornu
18:setglobal nu
19:setlocal rnu
20:redir @c | setglobal nu? | redir END
21:set nonu nornu
22:setglobal rnu
23:setlocal nu
24:redir @d | setglobal rnu? | redir END
25:$put =':setlocal must NOT reset the other global value'
26:$put c
27:$put d
28:"
29:set nonu nornu
30:setglobal nu
31:setglobal rnu
32:redir @e | setglobal nu? | redir END
33:set nonu nornu
34:setglobal rnu
35:setglobal nu
36:redir @f | setglobal rnu? | redir END
37:$put =':setglobal MUST reset the other global value'
38:$put e
39:$put f
40:"
41:set nonu nornu
42:set nu
43:set rnu
44:redir @g | setglobal nu? | redir END
45:set nonu nornu
46:set rnu
47:set nu
48:redir @h | setglobal rnu? | redir END
49:$put =':set MUST reset the other global value'
50:$put g
51:$put h
52:"
Bram Moolenaarf4c5fcb2013-07-03 17:14:00 +020053:let cwd=getcwd()
Bram Moolenaar8e46f722013-07-13 14:08:16 +020054:cd ..
55:" Tests may be run from a shadow directory, so an extra cd needs to be done to
56:" get above src/
57:if fnamemodify(getcwd(), ':t') != 'src' | cd ../.. | else | cd .. | endif
Bram Moolenaarf4c5fcb2013-07-03 17:14:00 +020058:$put =''
59:$put ='Testing findfile'
60:$put =''
Bram Moolenaara3c084c2013-07-04 20:50:46 +020061:set ssl
Bram Moolenaarf4c5fcb2013-07-03 17:14:00 +020062:$put =findfile('test19.in','src/test*')
63:exe "cd" cwd
64:cd ..
65:$put =findfile('test19.in','test*')
66:$put =findfile('test19.in','testdir')
67:exe "cd" cwd
Bram Moolenaar00154502013-02-13 16:15:55 +010068:/^results/,$w! test.out
69:q!
70ENDTEST
71