]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0757: tests: messages files contains ANSI escape sequences v9.1.0757
authorChristian Brabandt <cb@256bit.org>
Thu, 3 Oct 2024 14:38:52 +0000 (16:38 +0200)
committerChristian Brabandt <cb@256bit.org>
Thu, 3 Oct 2024 14:38:52 +0000 (16:38 +0200)
Problem:  tests: messages files contains ANSI escape sequences
Solution: filter those out in runtests.vim

Also, since we are setting $LC_ALL, we don't need to set $LANG and
$LANGUAGE since those are overridden by $LC_ALL anyhow.

closes: #15788

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/Makefile
src/testdir/runtest.vim
src/version.c

index 7a4c4c484d8deced1ff1393370c11f3f9d273a46..b6e8c802482f8ce80c0a5051045f71ab0f958561 100644 (file)
@@ -12,7 +12,7 @@ SCRIPTSOURCE = ../../runtime
 # Comment out this line to see the verbose output of tests.
 #
 # Catches SwapExists to avoid hanging at the ATTENTION prompt.
-REDIR_TEST_TO_NULL = --cmd 'au SwapExists * let v:swapchoice = "e"' | LC_ALL=C LANG=C LANGUAGE=C awk '/Executing Test_/{match($$0, "([0-9][0-9]:[0-9][0-9] *)?Executing Test_[^\\)]*\\)"); print substr($$0, RSTART, RLENGTH) "\r"; fflush()}'
+REDIR_TEST_TO_NULL = --cmd 'au SwapExists * let v:swapchoice = "e"' | LC_ALL=C awk '/Executing Test_/{match($$0, "([0-9][0-9]:[0-9][0-9] *)?Executing Test_[^\\)]*\\)"); print substr($$0, RSTART, RLENGTH) "\r"; fflush()}'
 
 # Uncomment this line to use valgrind for memory leaks and extra warnings.
 #   The output goes into a file "valgrind.testN"
index 133993d4ffda811fefe714e4c11c6b13bc8aa8f3..7ac48455e8e79dc45696672f5ff3b22f4b9a5298 100644 (file)
@@ -522,11 +522,11 @@ func FinishTesting()
   " Add SKIPPED messages
   call extend(s:messages, s:skipped)
 
-  " Append messages to the file "messages"
+  " Append messages to the file "messages", but remove ANSI Escape sequences
   split messages
   call append(line('$'), '')
   call append(line('$'), 'From ' . g:testname . ':')
-  call append(line('$'), s:messages)
+  call append(line('$'), s:messages->map({_, val -> substitute(val, '\%x1b\[\d\?m', '', 'g')}))
   write
 
   qall!
index 633c1e6d51d869e8867ea2290a3eee15129b4a5e..2f01df8c6e72bb0e0f58b771b17b0210cdd339bd 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    757,
 /**/
     756,
 /**/