Permalink
Browse files

patch 8.0.0359: 'number' and 'relativenumber' are not properly tested

Problem:    'number' and 'relativenumber' are not properly tested.
Solution:   Add tests, change old style to new style tests. (Ozaki Kiichi,
            closes #1447)
  • Loading branch information...
brammool committed Feb 23, 2017
1 parent 60629d6 commit dc9a081712ec8c140e6d4909e9f6b03a629d32d3
View
@@ -2082,7 +2082,7 @@ test1 \
test50 test51 test52 test53 test54 test55 test56 test57 test58 test59 \
test60 test64 test65 test66 test67 test68 test69 \
test70 test72 test73 test74 test75 test77 test78 test79 \
- test80 test82 test83 test84 test85 test86 test87 test88 test89 \
+ test80 test82 test83 test84 test85 test86 test87 test88 \
test90 test91 test94 test95 test97 test98 test99 \
test100 test101 test103 test104 test107 test108:
cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
@@ -2122,6 +2122,7 @@ test_arglist \
test_fileformat \
test_filter_cmd \
test_filter_map \
+ test_findfile \
test_float_func \
test_fnameescape \
test_fnamemodify \
@@ -2164,6 +2165,7 @@ test_arglist \
test_nested_function \
test_netbeans \
test_normal \
+ test_number \
test_options \
test_packadd \
test_partial \
View
@@ -117,8 +117,7 @@ SCRIPTS_MORE4 = \
test59.out \
test72.out \
test78.out \
- test83.out \
- test89.out
+ test83.out
# Tests specifically for MS-Windows.
@@ -174,6 +173,7 @@ NEW_TESTS = test_arglist.res \
test_nested_function.res \
test_netbeans.res \
test_normal.res \
+ test_number.res \
test_packadd.res \
test_paste.res \
test_perl.res \
View
@@ -91,7 +91,7 @@ SCRIPT = test1.out test3.out test4.out test5.out \
test66.out test67.out test68.out test69.out \
test72.out test75.out \
test77a.out test78.out test79.out test80.out \
- test82.out test84.out test88.out test89.out \
+ test82.out test84.out test88.out \
test90.out test91.out test94.out \
test95.out test98.out test99.out \
test103.out test104.out \
View
@@ -1,71 +0,0 @@
-- Some tests for setting 'number' and 'relativenumber'
- This is not all that useful now that the options are no longer reset when
- setting the other.
-- Some tests for findfile() function
-
-STARTTEST
-:so small.vim
-:set hidden nocp nu rnu viminfo+=nviminfo
-:redir @a | set nu? rnu? | redir END
-:e! xx
-:redir @b | set nu? rnu? | redir END
-:e! #
-:$put ='results:'
-:$put a
-:$put b
-:"
-:set nonu nornu
-:setglobal nu
-:setlocal rnu
-:redir @c | setglobal nu? | redir END
-:set nonu nornu
-:setglobal rnu
-:setlocal nu
-:redir @d | setglobal rnu? | redir END
-:$put =':setlocal must NOT reset the other global value'
-:$put c
-:$put d
-:"
-:set nonu nornu
-:setglobal nu
-:setglobal rnu
-:redir @e | setglobal nu? | redir END
-:set nonu nornu
-:setglobal rnu
-:setglobal nu
-:redir @f | setglobal rnu? | redir END
-:$put =':setglobal MUST reset the other global value'
-:$put e
-:$put f
-:"
-:set nonu nornu
-:set nu
-:set rnu
-:redir @g | setglobal nu? | redir END
-:set nonu nornu
-:set rnu
-:set nu
-:redir @h | setglobal rnu? | redir END
-:$put =':set MUST reset the other global value'
-:$put g
-:$put h
-:"
-:let cwd=getcwd()
-:cd ..
-:" Tests may be run from a shadow directory, so an extra cd needs to be done to
-:" get above src/
-:if fnamemodify(getcwd(), ':t') != 'src' | cd ../.. | else | cd .. | endif
-:$put =''
-:$put ='Testing findfile'
-:$put =''
-:set ssl
-:$put =findfile('test19.in','src/test*')
-:exe "cd" cwd
-:cd ..
-:$put =findfile('test19.in','test*')
-:$put =findfile('test19.in','testdir')
-:exe "cd" cwd
-:/^results/,$w! test.out
-:q!
-ENDTEST
-
View
@@ -1,28 +0,0 @@
-results:
-
- number
- relativenumber
-
- number
- relativenumber
-:setlocal must NOT reset the other global value
-
- number
-
- relativenumber
-:setglobal MUST reset the other global value
-
- number
-
- relativenumber
-:set MUST reset the other global value
-
- number
-
- relativenumber
-
-Testing findfile
-
-src/testdir/test19.in
-testdir/test19.in
-testdir/test19.in
@@ -16,6 +16,7 @@ source test_file_perm.vim
source test_fileformat.vim
source test_filter_cmd.vim
source test_filter_map.vim
+source test_findfile.vim
source test_float_func.vim
source test_fnamemodify.vim
source test_functions.vim
@@ -0,0 +1,25 @@
+" Test for findfile()
+"
+func Test_findfile()
+ new
+ let cwd=getcwd()
+ cd ..
+
+ " Tests may be run from a shadow directory, so an extra cd needs to be done to
+ " get above src/
+ if fnamemodify(getcwd(), ':t') != 'src'
+ cd ../..
+ else
+ cd ..
+ endif
+ set ssl
+
+ call assert_equal('src/testdir/test_findfile.vim', findfile('test_findfile.vim','src/test*'))
+ exe "cd" cwd
+ cd ..
+ call assert_equal('testdir/test_findfile.vim', findfile('test_findfile.vim','test*'))
+ call assert_equal('testdir/test_findfile.vim', findfile('test_findfile.vim','testdir'))
+
+ exe "cd" cwd
+ q!
+endfunc
Oops, something went wrong.

0 comments on commit dc9a081

Please sign in to comment.