From: zeertzjq Date: Thu, 9 Apr 2026 22:21:23 +0000 (+0000) Subject: patch 9.2.0330: tests: some patterns in tar and zip plugin tests not strict enough X-Git-Tag: v9.2.0330^0 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2fbc69c9adbaac5cd33d30a3ccbcb9b3f40eba41;p=thirdparty%2Fvim.git patch 9.2.0330: tests: some patterns in tar and zip plugin tests not strict enough Problem: Some patterns in tar and zip plugin tests not strict enough. Solution: Use assert_equal() for lines that should match exactly. Match a literal dot properly (zeertzjq). closes: #19946 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- diff --git a/src/testdir/test_plugin_tar.vim b/src/testdir/test_plugin_tar.vim index bde79052dd..80b7a76d6d 100644 --- a/src/testdir/test_plugin_tar.vim +++ b/src/testdir/test_plugin_tar.vim @@ -22,8 +22,8 @@ def g:Test_tar_basic() assert_match('^" Browsing tarfile .*/X.tar', getline(2)) assert_match('^" Select a file with cursor and press ENTER, "x" to extract a file', getline(3)) assert_match('^$', getline(4)) - assert_match('testtar/', getline(5)) - assert_match('testtar/file1.txt', getline(6)) + assert_equal('testtar/', getline(5)) + assert_equal('testtar/file1.txt', getline(6)) ### Check ENTER on header :1 @@ -78,7 +78,7 @@ def g:Test_tar_evil() assert_match('^" Select a file with cursor and press ENTER, "x" to extract a file', getline(3)) assert_match('^" Note: Path Traversal Attack detected', getline(4)) assert_match('^$', getline(5)) - assert_match('/etc/ax-pwn', getline(6)) + assert_equal('/etc/ax-pwn', getline(6)) ### Check ENTER on header :1 @@ -141,7 +141,7 @@ def g:Test_tar_path_traversal_with_nowrapscan() assert_match('^" Select a file with cursor and press ENTER, "x" to extract a file', getline(3)) assert_match('^" Note: Path Traversal Attack detected', getline(4)) assert_match('^$', getline(5)) - assert_match('/etc/ax-pwn', getline(6)) + assert_equal('/etc/ax-pwn', getline(6)) assert_equal(1, b:leading_slash) @@ -252,7 +252,7 @@ def g:Test_extraction() delete('X.txt') execute 'edit ' .. dir .. '/' .. c.archive - assert_match('X.txt', getline(5), 'line 5 wrong in archive: ' .. c.archive) + assert_equal('X.txt', getline(5), 'line 5 wrong in archive: ' .. c.archive) :5 normal x assert_equal(0, v:shell_error, 'vshell error not 0') @@ -281,7 +281,7 @@ def g:Test_extract_with_dotted_dir() defer delete(tarpath) execute 'e ' .. tarpath - assert_match('X.txt', getline(5)) + assert_equal('X.txt', getline(5)) :5 normal x assert_true(filereadable('X.txt')) @@ -305,7 +305,7 @@ def g:Test_extract_with_dotted_filename() defer delete(tarpath) execute 'e ' .. tarpath - assert_match('X.txt', getline(5)) + assert_equal('X.txt', getline(5)) :5 normal x assert_true(filereadable('X.txt')) diff --git a/src/testdir/test_plugin_zip.vim b/src/testdir/test_plugin_zip.vim index 3d39e24ef7..4357131543 100644 --- a/src/testdir/test_plugin_zip.vim +++ b/src/testdir/test_plugin_zip.vim @@ -22,7 +22,7 @@ def g:Test_zip_basic() ### Check header assert_match('^" zip\.vim version v\d\+', getline(1)) - assert_match('^" Browsing zipfile .*/X.zip', getline(2)) + assert_match('^" Browsing zipfile .*/X\.zip', getline(2)) assert_match('^" Select a file with cursor and press ENTER', getline(3)) assert_match('^$', getline(4)) @@ -43,7 +43,7 @@ def g:Test_zip_basic() :1 search('file.txt') exe ":normal \" - assert_match('zipfile://.*/X.zip::Xzip/file.txt', @%) + assert_match('zipfile://.*/X\.zip::Xzip/file\.txt', @%) assert_equal('one', getline(1)) ### Check editing file @@ -68,7 +68,7 @@ def g:Test_zip_basic() assert_true(filereadable("Xzip/file.txt")) ## Check not overwriting existing file - assert_match(' .* not overwriting!', execute("normal x")) + assert_match(' .* not overwriting!', execute("normal x")) delete("Xzip", "rf") @@ -118,7 +118,7 @@ def g:Test_zip_basic() ### Check when "zip" report failure if executable("false") g:zip_zipcmd = "false" - assert_match('sorry, unable to update .*/X.zip with Xzip/file.txt', + assert_match('sorry, unable to update .*/X\.zip with Xzip/file\.txt', execute("write")) endif bw!|bw @@ -189,7 +189,7 @@ def g:Test_zip_glob_fname() fname = 'a[a].txt' search('\V' .. fname) exe ":normal \" - assert_match('zipfile://.*/X.zip::zipglob/a\[a\].txt', @%) + assert_match('zipfile://.*/X\.zip::zipglob/a\[a\]\.txt', @%) assert_equal('a test file with []', getline(1)) bw @@ -198,7 +198,7 @@ def g:Test_zip_glob_fname() fname = 'a*.txt' search('\V' .. fname) exe ":normal \" - assert_match('zipfile://.*/X.zip::zipglob/a\*.txt', @%) + assert_match('zipfile://.*/X\.zip::zipglob/a\*\.txt', @%) assert_equal('a test file with a*', getline(1)) bw @@ -207,7 +207,7 @@ def g:Test_zip_glob_fname() fname = 'a?.txt' search('\V' .. fname) exe ":normal \" - assert_match('zipfile://.*/X.zip::zipglob/a?.txt', @%) + assert_match('zipfile://.*/X\.zip::zipglob/a?\.txt', @%) assert_equal('a test file with a?', getline(1)) bw @@ -216,7 +216,7 @@ def g:Test_zip_glob_fname() fname = 'a\.txt' search('\V' .. escape(fname, '\\')) exe ":normal \" - assert_match('zipfile://.*/X.zip::zipglob/a\\.txt', @%) + assert_match('zipfile://.*/X\.zip::zipglob/a\\\.txt', @%) assert_equal('a test file with a\', getline(1)) bw @@ -225,7 +225,7 @@ def g:Test_zip_glob_fname() fname = 'a\\.txt' search('\V' .. escape(fname, '\\')) exe ":normal \" - assert_match('zipfile://.*/X.zip::zipglob/a\\\\.txt', @%) + assert_match('zipfile://.*/X\.zip::zipglob/a\\\\\.txt', @%) assert_equal('a test file with a double \', getline(1)) bw diff --git a/src/version.c b/src/version.c index c418648bbb..535e85ef85 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 330, /**/ 329, /**/