To: vim_dev@googlegroups.com Subject: Patch 8.2.1305 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1305 Problem: Some tests are still old style. Solution: Convert tests 52 and 70 to new style. (Yegappan Lakshmanan, closes #6544) Fix error in FinishTesting(). Files: src/testdir/runtest.vim, src/Makefile, src/testdir/Make_all.mak, src/testdir/Make_amiga.mak, src/testdir/Make_vms.mms, src/testdir/test52.in, src/testdir/test52.ok, src/testdir/test70.in, src/testdir/test70.ok, src/testdir/test_mzscheme.vim, src/testdir/test_writefile.vim *** ../vim-8.2.1304/src/testdir/runtest.vim 2020-07-27 19:47:02.972971153 +0200 --- src/testdir/runtest.vim 2020-07-27 19:59:51.725246826 +0200 *************** *** 447,453 **** " - it fails again with the same message " - it fails five times (with a different message) if len(v:errors) > 0 ! \ $TEST_NO_RETRY == '' \ && (index(s:flaky_tests, g:testfunc) >= 0 \ || g:test_is_flaky) while 1 --- 447,453 ---- " - it fails again with the same message " - it fails five times (with a different message) if len(v:errors) > 0 ! \ && $TEST_NO_RETRY == '' \ && (index(s:flaky_tests, g:testfunc) >= 0 \ || g:test_is_flaky) while 1 *** ../vim-8.2.1304/src/Makefile 2020-07-26 12:52:53.552746207 +0200 --- src/Makefile 2020-07-27 19:56:12.306230053 +0200 *************** *** 2310,2319 **** # Run individual OLD style test. # These do not depend on the executable, compile it when needed. ! test1 \ ! test42 test49 \ ! test52 test59 \ ! test70: cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTESTTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE) # Run individual NEW style test. --- 2310,2316 ---- # Run individual OLD style test. # These do not depend on the executable, compile it when needed. ! test1 test42 test49 test59: cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTESTTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE) # Run individual NEW style test. *** ../vim-8.2.1304/src/testdir/Make_all.mak 2020-07-26 12:52:53.552746207 +0200 --- src/testdir/Make_all.mak 2020-07-27 19:58:37.217576351 +0200 *************** *** 8,32 **** NO_INITS = -U NONE $(NO_PLUGINS) # The first script creates small.vim. ! SCRIPTS_FIRST = \ ! test1.out # Tests that run on all systems. ! SCRIPTS_ALL = \ ! test42.out \ ! test70.out # Tests that run on most systems, but not on Amiga. ! SCRIPTS_MORE1 = \ ! test52.out # Tests that run on most systems, but not on Amiga and DOS/Windows. ! SCRIPTS_MORE2 = \ ! test49.out # Tests that run on most systems, but not on VMS ! SCRIPTS_MORE4 = \ ! test59.out # Tests specifically for MS-Windows. SCRIPTS_WIN32 = --- 8,26 ---- NO_INITS = -U NONE $(NO_PLUGINS) # The first script creates small.vim. ! SCRIPTS_FIRST = test1.out # Tests that run on all systems. ! SCRIPTS_ALL = test42.out # Tests that run on most systems, but not on Amiga. ! SCRIPTS_MORE1 = # Tests that run on most systems, but not on Amiga and DOS/Windows. ! SCRIPTS_MORE2 = test49.out # Tests that run on most systems, but not on VMS ! SCRIPTS_MORE4 = test59.out # Tests specifically for MS-Windows. SCRIPTS_WIN32 = *************** *** 194,199 **** --- 188,194 ---- test_modeless \ test_modeline \ test_move \ + test_mzscheme \ test_nested_function \ test_netbeans \ test_normal \ *************** *** 426,431 **** --- 421,427 ---- test_mksession.res \ test_modeless.res \ test_modeline.res \ + test_mzscheme.res \ test_nested_function.res \ test_netbeans.res \ test_normal.res \ *** ../vim-8.2.1304/src/testdir/Make_amiga.mak 2019-07-05 20:40:37.000000000 +0200 --- src/testdir/Make_amiga.mak 2020-07-27 19:56:12.306230053 +0200 *************** *** 9,20 **** include Make_all.mak - # These tests don't work (yet): - # test2 "\\tmp" doesn't work - # test10 'errorformat' is different - # test52 only for Win32 - # test86, 87 no Python interface - SCRIPTS = $(SCRIPTS_ALL) $(SCRIPTS_MORE4) # Must run test1 first to create small.vim. --- 9,14 ---- *** ../vim-8.2.1304/src/testdir/Make_vms.mms 2020-07-26 12:52:53.552746207 +0200 --- src/testdir/Make_vms.mms 2020-07-27 19:56:12.306230053 +0200 *************** *** 81,120 **** # test59: Failed/Hangs - VMS does not support spell files (file names # with too many dots). # - # test78: bug - Vim dies at :recover Xtest - # test89: bug - findfile() does not work on VMS (just in the current directory) - # test102: Just ODS-5 supports space and special chars in the filename. - # On ODS-2 tests fail. .IFDEF WANT_GUI - SCRIPT_GUI = test16.out GUI_OPTION = -g .ENDIF .IFDEF WANT_UNIX ! SCRIPT_UNIX = test10.out test27.out test49.out ! .ENDIF ! ! .IFDEF WANT_WIN ! SCRIPT_WIN = test52.out .ENDIF .IFDEF WANT_SPELL SCRIPT_SPELL = test59.out .ENDIF - .IFDEF WANT_MZSCH - SCRIPT_MZSCH = test70.out - .ENDIF - - .IFDEF HAVE_ODS5 - SCRIPT_ODS5 = test102.out - .ENDIF - - .IFDEF HAVE_GDIFF - SCRIPT_GDIFF = test47.out - .ENDIF - .in.out : -@ !clean up before doing the test -@ if "''F$SEARCH("test.out.*")'" .NES. "" then delete/noconfirm/nolog test.out.* --- 81,99 ---- # test59: Failed/Hangs - VMS does not support spell files (file names # with too many dots). # .IFDEF WANT_GUI GUI_OPTION = -g .ENDIF .IFDEF WANT_UNIX ! SCRIPT_UNIX = test49.out .ENDIF .IFDEF WANT_SPELL SCRIPT_SPELL = test59.out .ENDIF .in.out : -@ !clean up before doing the test -@ if "''F$SEARCH("test.out.*")'" .NES. "" then delete/noconfirm/nolog test.out.* *************** *** 135,142 **** -@ if "''F$SEARCH("Xdotest.*")'" .NES. "" then delete/noconfirm/nolog Xdotest.*.* -@ if "''F$SEARCH("Xtest.*")'" .NES. "" then delete/noconfirm/nolog Xtest.*.* ! all : clean nolog $(START_WITH) $(SCRIPT) $(SCRIPT_GUI) $(SCRIPT_UNIX) $(SCRIPT_WIN) $(SCRIPT_SPELL) $(SCRIPT_ODS5) \ ! $(SCRIPT_GDIFF) $(SCRIPT_MZSCH) $(SCRIPT_LUA) nolog -@ write sys$output " " -@ write sys$output "-----------------------------------------------" -@ write sys$output " All done" --- 114,121 ---- -@ if "''F$SEARCH("Xdotest.*")'" .NES. "" then delete/noconfirm/nolog Xdotest.*.* -@ if "''F$SEARCH("Xtest.*")'" .NES. "" then delete/noconfirm/nolog Xtest.*.* ! all : clean nolog $(START_WITH) $(SCRIPT) $(SCRIPT_UNIX) $(SCRIPT_SPELL) \ ! nolog -@ write sys$output " " -@ write sys$output "-----------------------------------------------" -@ write sys$output " All done" *** ../vim-8.2.1304/src/testdir/test52.in 2010-05-15 13:04:10.000000000 +0200 --- src/testdir/test52.in 1970-01-01 01:00:00.000000000 +0100 *************** *** 1,65 **** - Tests for reading and writing files with conversion for Win32. - - STARTTEST - :so mbyte.vim - :" make this a dummy test for non-Win32 systems - :if !has("win32") | e! test.ok | wq! test.out | endif - :" - :" write tests: - :" combine three values for 'encoding' with three values for 'fileencoding' - :" also write files for read tests - /^1 - :set encoding=utf-8 - :.w! ++enc=utf-8 test.out - :.w ++enc=cp1251 >>test.out - :.w ++enc=cp866 >>test.out - :.w! ++enc=utf-8 Xutf8 - /^2 - :set encoding=cp1251 - :.w ++enc=utf-8 >>test.out - :.w ++enc=cp1251 >>test.out - :.w ++enc=cp866 >>test.out - :.w! ++enc=cp1251 Xcp1251 - /^3 - :set encoding=cp866 - :.w ++enc=utf-8 >>test.out - :.w ++enc=cp1251 >>test.out - :.w ++enc=cp866 >>test.out - :.w! ++enc=cp866 Xcp866 - :" - :" read three 'fileencoding's with utf-8 'encoding' - :set encoding=utf-8 fencs=utf-8,cp1251 - :e Xutf8 - :.w ++enc=utf-8 >>test.out - :e Xcp1251 - :.w ++enc=utf-8 >>test.out - :set fencs=utf-8,cp866 - :e Xcp866 - :.w ++enc=utf-8 >>test.out - :" - :" read three 'fileencoding's with cp1251 'encoding' - :set encoding=utf-8 fencs=utf-8,cp1251 - :e Xutf8 - :.w ++enc=cp1251 >>test.out - :e Xcp1251 - :.w ++enc=cp1251 >>test.out - :set fencs=utf-8,cp866 - :e Xcp866 - :.w ++enc=cp1251 >>test.out - :" - :" read three 'fileencoding's with cp866 'encoding' - :set encoding=cp866 fencs=utf-8,cp1251 - :e Xutf8 - :.w ++enc=cp866 >>test.out - :e Xcp1251 - :.w ++enc=cp866 >>test.out - :set fencs=utf-8,cp866 - :e Xcp866 - :.w ++enc=cp866 >>test.out - :" - :qa! - ENDTEST - - 1 utf-8 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 - 2 cp1251 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 - 3 cp866 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 --- 0 ---- *** ../vim-8.2.1304/src/testdir/test52.ok 2010-05-15 13:04:10.000000000 +0200 --- src/testdir/test52.ok 1970-01-01 01:00:00.000000000 +0100 *************** *** 1,18 **** - 1 utf-8 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 - 1 utf-8 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 - 1 utf-8 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 - 2 cp1251 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 - 2 cp1251 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 - 2 cp1251 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 - 3 cp866 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 - 3 cp866 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 - 3 cp866 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 - 1 utf-8 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 - 2 cp1251 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 - 3 cp866 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 - 1 utf-8 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 - 2 cp1251 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 - 3 cp866 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 - 1 utf-8 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 - 2 cp1251 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 - 3 cp866 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 --- 0 ---- *** ../vim-8.2.1304/src/testdir/test70.in 2019-09-01 19:14:34.000000000 +0200 --- src/testdir/test70.in 1970-01-01 01:00:00.000000000 +0100 *************** *** 1,63 **** - Smoke test for MzScheme interface and mzeval() function - - STARTTEST - :so mzscheme.vim - :set nocompatible viminfo+=nviminfo - :function! MzRequire() - :redir => l:mzversion - :mz (version) - :redir END - :if strpart(l:mzversion, 1, 1) < "4" - :" MzScheme versions < 4.x: - :mz (require (prefix vim- vimext)) - :else - :" newer versions: - :mz (require (prefix-in vim- 'vimext)) - :mz (require r5rs) - :endif - :endfunction - :silent call MzRequire() - :mz (define l '("item0" "dictionary with list OK" "item2")) - :mz (define h (make-hash)) - :mz (hash-set! h "list" l) - /^1 - :" change buffer contents - :mz (vim-set-buff-line (vim-eval "line('.')") "1 changed line 1") - :" scalar test - :let tmp_string = mzeval('"string"') - :let tmp_1000 = '1000'->mzeval() - :if tmp_string . tmp_1000 == "string1000" - :let scalar_res = "OK" - :else - :let scalar_res = "FAILED" - :endif - :call append(search("^1"), "scalar test " . scalar_res) - :" dictionary containing a list - :let tmp = mzeval("h")["list"][1] - :/^2/put =tmp - :" circular list (at the same time test lists containing lists) - :mz (set-car! (cddr l) l) - :let l2 = mzeval("h")["list"] - :if l2[2] == l2 - :let res = "OK" - :else - :let res = "FAILED: " . l2[2] - :endif - :call setline(search("^3"), "circular test " . res) - :" funcrefs - :mz (define vim:max (vim-eval "function('max')")) - :mz (define m (vim:max '(1 100 8))) - :let m = mzeval('m') - :if m == 100 - :let fref_res = "OK" - :else - :let fref_res = "FAILED: " . m - :end - :call append(line('$'), 'funcrefs '. fref_res) - :?^1?,$w! test.out - :qa! - ENDTEST - - 1 line 1 - 2 line 2 - 3 line 3 --- 0 ---- *** ../vim-8.2.1304/src/testdir/test70.ok 2013-01-30 14:26:44.000000000 +0100 --- src/testdir/test70.ok 1970-01-01 01:00:00.000000000 +0100 *************** *** 1,6 **** - 1 changed line 1 - scalar test OK - 2 line 2 - dictionary with list OK - circular test OK - funcrefs OK --- 0 ---- *** ../vim-8.2.1304/src/testdir/test_mzscheme.vim 2020-07-27 20:00:57.128960649 +0200 --- src/testdir/test_mzscheme.vim 2020-07-27 19:56:12.306230053 +0200 *************** *** 0 **** --- 1,62 ---- + " Test for MzScheme interface and mzeval() function + + source check.vim + CheckFeature mzscheme + + func MzRequire() + redir => l:mzversion + mz (version) + redir END + if strpart(l:mzversion, 1, 1) < "4" + " MzScheme versions < 4.x: + mz (require (prefix vim- vimext)) + else + " newer versions: + mz (require (prefix-in vim- 'vimext)) + mz (require r5rs) + endif + endfunc + + func Test_mzscheme() + new + let lines =<< trim END + 1 line 1 + 2 line 2 + 3 line 3 + END + call setline(1, lines) + + call MzRequire() + mz (define l '("item0" "dictionary with list OK" "item2")) + mz (define h (make-hash)) + mz (hash-set! h "list" l) + + call cursor(1, 1) + " change buffer contents + mz (vim-set-buff-line (vim-eval "line('.')") "1 changed line 1") + call assert_equal('1 changed line 1', getline(1)) + + " scalar test + let tmp_string = mzeval('"string"') + let tmp_1000 = '1000'->mzeval() + call assert_equal('string1000', tmp_string .. tmp_1000) + + " dictionary containing a list + call assert_equal('dictionary with list OK', mzeval("h")["list"][1]) + + call cursor(2, 1) + " circular list (at the same time test lists containing lists) + mz (set-car! (cddr l) l) + let l2 = mzeval("h")["list"] + call assert_equal(l2[2], l2) + + " funcrefs + mz (define vim:max (vim-eval "function('max')")) + mz (define m (vim:max '(1 100 8))) + let m = mzeval('m') + call assert_equal(100, m) + + close! + endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.1304/src/testdir/test_writefile.vim 2020-07-11 22:14:54.318422203 +0200 --- src/testdir/test_writefile.vim 2020-07-27 19:56:12.306230053 +0200 *************** *** 442,445 **** --- 442,559 ---- close! endfunc + " Tests for reading and writing files with conversion for Win32. + func Test_write_file_encoding() + CheckMSWindows + let save_encoding = &encoding + let save_fileencodings = &fileencodings + set encoding& fileencodings& + let text =<< trim END + 1 utf-8 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 + 2 cp1251 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 + 3 cp866 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 + END + call writefile(text, 'Xfile') + edit Xfile + + " write tests: + " combine three values for 'encoding' with three values for 'fileencoding' + " also write files for read tests + call cursor(1, 1) + set encoding=utf-8 + .w! ++enc=utf-8 Xtest + .w ++enc=cp1251 >> Xtest + .w ++enc=cp866 >> Xtest + .w! ++enc=utf-8 Xutf8 + let expected =<< trim END + 1 utf-8 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 + 1 utf-8 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 + 1 utf-8 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 + END + call assert_equal(expected, readfile('Xtest')) + + call cursor(2, 1) + set encoding=cp1251 + .w! ++enc=utf-8 Xtest + .w ++enc=cp1251 >> Xtest + .w ++enc=cp866 >> Xtest + .w! ++enc=cp1251 Xcp1251 + let expected =<< trim END + 2 cp1251 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 + 2 cp1251 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 + 2 cp1251 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 + END + call assert_equal(expected, readfile('Xtest')) + + call cursor(3, 1) + set encoding=cp866 + .w! ++enc=utf-8 Xtest + .w ++enc=cp1251 >> Xtest + .w ++enc=cp866 >> Xtest + .w! ++enc=cp866 Xcp866 + let expected =<< trim END + 3 cp866 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 + 3 cp866 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 + 3 cp866 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 + END + call assert_equal(expected, readfile('Xtest')) + + " read three 'fileencoding's with utf-8 'encoding' + set encoding=utf-8 fencs=utf-8,cp1251 + e Xutf8 + .w! ++enc=utf-8 Xtest + e Xcp1251 + .w ++enc=utf-8 >> Xtest + set fencs=utf-8,cp866 + e Xcp866 + .w ++enc=utf-8 >> Xtest + let expected =<< trim END + 1 utf-8 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 + 2 cp1251 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 + 3 cp866 text: Для Vim version 6.2. Последнее изменение: 1970 Jan 01 + END + call assert_equal(expected, readfile('Xtest')) + + " read three 'fileencoding's with cp1251 'encoding' + set encoding=utf-8 fencs=utf-8,cp1251 + e Xutf8 + .w! ++enc=cp1251 Xtest + e Xcp1251 + .w ++enc=cp1251 >> Xtest + set fencs=utf-8,cp866 + e Xcp866 + .w ++enc=cp1251 >> Xtest + let expected =<< trim END + 1 utf-8 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 + 2 cp1251 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 + 3 cp866 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01 + END + call assert_equal(expected, readfile('Xtest')) + + " read three 'fileencoding's with cp866 'encoding' + set encoding=cp866 fencs=utf-8,cp1251 + e Xutf8 + .w! ++enc=cp866 Xtest + e Xcp1251 + .w ++enc=cp866 >> Xtest + set fencs=utf-8,cp866 + e Xcp866 + .w ++enc=cp866 >> Xtest + let expected =<< trim END + 1 utf-8 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 + 2 cp1251 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 + 3 cp866 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01 + END + call assert_equal(expected, readfile('Xtest')) + + call delete('Xfile') + call delete('Xtest') + call delete('Xutf8') + call delete('Xcp1251') + call delete('Xcp866') + let &encoding = save_encoding + let &fileencodings = save_fileencodings + %bw! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.1304/src/version.c 2020-07-27 19:47:02.972971153 +0200 --- src/version.c 2020-07-27 20:00:45.005013504 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1305, /**/ -- From "know your smileys": :q vi user saying, "How do I get out of this damn emacs editor?" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///