]> granicus.if.org Git - vim/commitdiff
patch 8.1.2421: test88 is old style v8.1.2421
authorBram Moolenaar <Bram@vim.org>
Wed, 11 Dec 2019 19:12:26 +0000 (20:12 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 11 Dec 2019 19:12:26 +0000 (20:12 +0100)
Problem:    Test88 is old style.
Solution:   Turn into a new style test. (Yegappan Lakshmanan, closes #5347)

src/Makefile
src/testdir/Make_all.mak
src/testdir/Make_vms.mms
src/testdir/test88.in [deleted file]
src/testdir/test88.ok [deleted file]
src/testdir/test_conceal.vim
src/testdir/test_python2.vim
src/testdir/test_python3.vim
src/version.c

index 6339a528e5473683521bac5ac9bba036591917d1..1fe94f5e258e97f17245ecc19d0eb29a3e2caf75 100644 (file)
@@ -2257,7 +2257,7 @@ test1 \
        test52 test59 \
        test64 test69 \
        test70 test72 \
-       test86 test87 test88 \
+       test86 test87 \
        test95 test99:
        cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTESTTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
 
index 567d308b5580863954a7c6a866125623d52a0902..665bcc77659398163cdfb5795192e64fc2525393 100644 (file)
@@ -18,7 +18,6 @@ SCRIPTS_ALL = \
        test64.out \
        test69.out \
        test70.out \
-       test88.out \
        test95.out \
        test99.out \
        test_eval.out
index f48a3cd2b7dfba78514fab7ad21ea24de7e2b7fc..e31060bd918bde127c52bb0c06868c0f0d946e50 100644 (file)
@@ -76,7 +76,7 @@ VIMPROG = <->vim.exe
 SCRIPT = test1.out \
        test42.out test44.out test49.out \
        test64.out test69.out \
-       test72.out test77a.out test88.out \
+       test72.out test77a.out \
        test95.out test99.out \
        test_eval.out
 
diff --git a/src/testdir/test88.in b/src/testdir/test88.in
deleted file mode 100644 (file)
index 9e43f70..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-vim: set ft=vim
-
-Tests for correct display (cursor column position) with +conceal and
-tabulators.
-
-STARTTEST
-:so small.vim
-:if !has('conceal')
-   e! test.ok
-   wq! test.out
-:endif
-:" Conceal settings.
-:set conceallevel=2
-:set concealcursor=nc
-:syntax match test /|/ conceal
-:" Save current cursor position. Only works in <expr> mode, can't be used
-:" with :normal because it moves the cursor to the command line. Thanks to ZyX
-:" <zyx.vim@gmail.com> for the idea to use an <expr> mapping.
-:let positions = []
-:nnoremap <expr> GG ":let positions += ['".screenrow().":".screencol()."']\n"
-:" Start test.
-/^start:
-:normal ztj
-GGk
-:" We should end up in the same column when running these commands on the two
-:" lines.
-:normal ft
-GGk
-:normal $
-GGk
-:normal 0j
-GGk
-:normal ft
-GGk
-:normal $
-GGk
-:normal 0j0j
-GGk
-:" Same for next test block.
-:normal ft
-GGk
-:normal $
-GGk
-:normal 0j
-GGk
-:normal ft
-GGk
-:normal $
-GGk
-:normal 0j0j
-GGk
-:" And check W with multiple tabs and conceals in a line.
-:normal W
-GGk
-:normal W
-GGk
-:normal W
-GGk
-:normal $
-GGk
-:normal 0j
-GGk
-:normal W
-GGk
-:normal W
-GGk
-:normal W
-GGk
-:normal $
-GGk
-:set lbr
-:normal $
-GGk
-:set list listchars=tab:>-
-:normal 0
-GGk
-:normal W
-GGk
-:normal W
-GGk
-:normal W
-GGk
-:normal $
-GGk
-:" Display result.
-:call append('$', 'end:')
-:call append('$', positions)
-:/^end/,$wq! test.out
-ENDTEST
-
-start:
-.concealed.     text
-|concealed|    text
-
-       .concealed.     text
-       |concealed|     text
-
-.a.    .b.     .c.     .d.
-|a|    |b|     |c|     |d|
diff --git a/src/testdir/test88.ok b/src/testdir/test88.ok
deleted file mode 100644 (file)
index 12949f2..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-end:
-2:1
-2:17
-2:20
-3:1
-3:17
-3:20
-5:8
-5:25
-5:28
-6:8
-6:25
-6:28
-8:1
-8:9
-8:17
-8:25
-8:27
-9:1
-9:9
-9:17
-9:25
-9:26
-9:26
-9:1
-9:9
-9:17
-9:25
-9:26
index bec21643b370d3dfdc42d2382ace1378025454d5..af0c3b8f799843f46cc6c3926f678950ac829526 100644 (file)
@@ -1,5 +1,4 @@
 " Tests for 'conceal'.
-" Also see test88.in (should be converted to a test function here).
 
 source check.vim
 CheckFeature conceal
@@ -155,3 +154,104 @@ func Test_conceal_resize_term()
   call StopVimInTerminal(buf)
   call delete('XTest_conceal_resize')
 endfunc
+
+" Tests for correct display (cursor column position) with +conceal and
+" tabulators.  Need to run this test in a separate Vim instance. Otherwise the
+" screen is not updated (lazy redraw) and the cursor position is wrong.
+func Test_conceal_cursor_pos()
+  let code =<< trim [CODE]
+    :let l = ['start:', '.concealed.     text', "|concealed|\ttext"]
+    :let l += ['', "\t.concealed.\ttext", "\t|concealed|\ttext", '']
+    :let l += [".a.\t.b.\t.c.\t.d.", "|a|\t|b|\t|c|\t|d|"]
+    :call append(0, l)
+    :call cursor(1, 1)
+    :" Conceal settings.
+    :set conceallevel=2
+    :set concealcursor=nc
+    :syntax match test /|/ conceal
+    :" Save current cursor position. Only works in <expr> mode, can't be used
+    :" with :normal because it moves the cursor to the command line. Thanks
+    :" to ZyX <zyx.vim@gmail.com> for the idea to use an <expr> mapping.
+    :let curpos = []
+    :nnoremap <expr> GG ":let curpos += ['".screenrow().":".screencol()."']\n"
+    :normal ztj
+    GGk
+    :" We should end up in the same column when running these commands on the
+    :" two lines.
+    :normal ft
+    GGk
+    :normal $
+    GGk
+    :normal 0j
+    GGk
+    :normal ft
+    GGk
+    :normal $
+    GGk
+    :normal 0j0j
+    GGk
+    :" Same for next test block.
+    :normal ft
+    GGk
+    :normal $
+    GGk
+    :normal 0j
+    GGk
+    :normal ft
+    GGk
+    :normal $
+    GGk
+    :normal 0j0j
+    GGk
+    :" And check W with multiple tabs and conceals in a line.
+    :normal W
+    GGk
+    :normal W
+    GGk
+    :normal W
+    GGk
+    :normal $
+    GGk
+    :normal 0j
+    GGk
+    :normal W
+    GGk
+    :normal W
+    GGk
+    :normal W
+    GGk
+    :normal $
+    GGk
+    :set lbr
+    :normal $
+    GGk
+    :set list listchars=tab:>-
+    :normal 0
+    GGk
+    :normal W
+    GGk
+    :normal W
+    GGk
+    :normal W
+    GGk
+    :normal $
+    GGk
+    :call writefile(curpos, 'Xconceal_curpos.out')
+    :q!
+
+  [CODE]
+  call writefile(code, 'XTest_conceal_curpos')
+
+  if RunVim([], [], '-s XTest_conceal_curpos')
+    call assert_equal([
+          \ '2:1', '2:17', '2:20', '3:1', '3:17', '3:20', '5:8', '5:25',
+          \ '5:28', '6:8', '6:25', '6:28', '8:1', '8:9', '8:17', '8:25',
+          \ '8:27', '9:1', '9:9', '9:17', '9:25', '9:26', '9:26', '9:1',
+          \ '9:9', '9:17', '9:25', '9:26'], readfile('Xconceal_curpos.out'))
+  endif
+
+  call delete('Xconceal_curpos.out')
+  call delete('XTest_conceal_curpos')
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab
index de5b0c94ac081e6332e196dd5570ac644fb37dd0..5cee7a7305fc44142f1a835cbff340a8c0624b0f 100644 (file)
@@ -1,5 +1,5 @@
 " Test for python 2 commands.
-" TODO: move tests from test87.in here.
+" TODO: move tests from test86.in here.
 
 source check.vim
 CheckFeature python
index d66e54f9d718c0cab28ae74aba94e15df923f71b..28533028056a652c01048b13855e13ca6b01f9fe 100644 (file)
@@ -1,5 +1,5 @@
 " Test for python 3 commands.
-" TODO: move tests from test88.in here.
+" TODO: move tests from test87.in here.
 
 source check.vim
 CheckFeature python3
index 7b36fe320f9b9386a9072778d9b3ebcefb86e437..340867ddfea93633db5761d977e89141c4c3d4fd 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2421,
 /**/
     2420,
 /**/