]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1656: syntax test fails when detected shell type differs v9.0.1656
authorBram Moolenaar <Bram@vim.org>
Fri, 23 Jun 2023 23:56:50 +0000 (00:56 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 23 Jun 2023 23:56:50 +0000 (00:56 +0100)
Problem:    Syntax test fails when detected shell type differs.
Solution:   Avoid using "/bin/sh", it depends on the system.  Add a check that
            the shell type detection is correct.

17 files changed:
runtime/syntax/testdir/dumps/sh_01_00.dump
runtime/syntax/testdir/dumps/sh_01_99.dump
runtime/syntax/testdir/dumps/sh_02_00.dump
runtime/syntax/testdir/dumps/sh_03_00.dump
runtime/syntax/testdir/dumps/sh_04_00.dump
runtime/syntax/testdir/dumps/sh_05_00.dump
runtime/syntax/testdir/dumps/sh_06_00.dump
runtime/syntax/testdir/dumps/sh_07_00.dump
runtime/syntax/testdir/dumps/sh_08_00.dump
runtime/syntax/testdir/dumps/sh_09_00.dump
runtime/syntax/testdir/dumps/sh_09_99.dump
runtime/syntax/testdir/input/sh_01.sh
runtime/syntax/testdir/input/sh_04.sh
runtime/syntax/testdir/input/sh_07.sh
runtime/syntax/testdir/input/sh_09.sh
runtime/syntax/testdir/runtest.vim
src/version.c

index 437a2519f23eae80dd6cac683c6b876bcb0959ff..f38aff0dbfcf85db35591caa0a67d57c2d283f24 100644 (file)
@@ -1,4 +1,4 @@
->#+0#0000e05#ffffff0|!| |/|b|i|n|/|s|h| +0#0000000&@64
+>#+0#0000e05#ffffff0|!| |/|b|i|n|/|d|a|s|h| +0#0000000&@62
 |e+0#af5f00255&|x|p|o|r|t| +0#0000000&|`+0#e000e06&|e+0#af5f00255&|c|h|o| +0#e000002&|'+0#af5f00255&|A+0#e000002&|=|B|'+0#af5f00255&|`+0#e000e06&| +0#0000000&@55
 |p+0#af5f00255&|r|i|n|t|e|n|v| +0#0000000&|A| @64
 |e+0#af5f00255&|c|h|o| +0#e000002&|a| |`+0#e000e06&|#+0#0000e05&|f|o@1|`+0#e000e06&| +0#0000000&|b| @59
@@ -17,4 +17,4 @@
 |~| @73
 |~| @73
 |~| @73
-|"+0#0000000&|i|n|p|u|t|/|s|h|_|0|1|.|s|h|"| |4|L|,| |5|8|B| @32|1|,|1| @10|A|l@1| 
+|i+0#0000000&|s|_|d|a|s|h|:| |1|,| |i|s|_|p|o|s|i|x|:| |1|,| |i|s|_|s|h|:| |1|,| @22|1|,|1| @10|A|l@1| 
index cf45453b50a12098a165921431f2cc8df816b2b6..687677ed059063bdd0b383cefee805301ea83e92 100644 (file)
@@ -1,4 +1,4 @@
-|#+0#0000e05#ffffff0|!| |/|b|i|n|/|s|h| +0#0000000&@64
+|#+0#0000e05#ffffff0|!| |/|b|i|n|/|d|a|s|h| +0#0000000&@62
 |e+0#af5f00255&|x|p|o|r|t| +0#0000000&|`+0#e000e06&|e+0#af5f00255&|c|h|o| +0#e000002&|'+0#af5f00255&|A+0#e000002&|=|B|'+0#af5f00255&|`+0#e000e06&| +0#0000000&@55
 |p+0#af5f00255&|r|i|n|t|e|n|v| +0#0000000&|A| @64
 >e+0#af5f00255&|c|h|o| +0#e000002&|a| |`+0#e000e06&|#+0#0000e05&|f|o@1|`+0#e000e06&| +0#0000000&|b| @59
@@ -17,4 +17,4 @@
 |~| @73
 |~| @73
 |~| @73
-|"+0#0000000&|i|n|p|u|t|/|s|h|_|0|1|.|s|h|"| |4|L|,| |5|8|B| @32|4|,|1| @10|A|l@1| 
+|:+0#0000000&|r|e|d|r|a|w| @49|4|,|1| @10|A|l@1| 
index 5628423ae6111a98149f80be11e6d66f7d11b419..e752cc04cfef75b65f5868de715a3bc6bc2910e8 100644 (file)
@@ -17,4 +17,4 @@
 |#+0#0000e05&| |J|u|l| |2|6|,| |2|0|1|8|:| |w|h|y| |i|s|n|'|t| |`|.@1|`| |b|e|i|n|g| |t|e|r|m|i|n|a|t|e|d| |p|r|o|p|e|r|l|y|?| +0#0000000&@17
 |#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
 |c+0#af5f00255&|a|s|e| +0#0000000&|"+0#af5f00255&|$+0#e000e06&|a@2|"+0#af5f00255&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&@60
-|"|i|n|p|u|t|/|s|h|_|0|2|.|s|h|"| |3|0|L|,| |4|9|7|B| @30|1|,|1| @10|T|o|p| 
+|i|s|_|k|o|r|n|s|h|e|l@1|:| |1|,| @40|1|,|1| @10|T|o|p| 
index 0c5576c8b73df5afc1f7cae139f6da433ffdbfd0..59eca0921e7b59d0b9b44dd379beb7b482797505 100644 (file)
@@ -17,4 +17,4 @@
 |a|s| |w|e|l@1| |a|s| |b|a|s|h| +0#0000000&@59
 |V+0#00e0e07&|a|r|i|a|b|l|e|=+0#0000000&|$+0#e000e06&|{|V|a|r|i|a|b|l|e|B|:+0#af5f00255&|-|$+0#e000e06&|{|V|a|r|i|a|b|l|e|C|:+0#af5f00255&|-|e+0#0000000&|n|g|}+0#e000e06&@1| +0#0000000&@7|#+0#0000e05&| |:|-| |i|s| |k|s|h| |a|n|d| |b|a|s|h| +0#0000000&@6
 @75
-|"|i|n|p|u|t|/|s|h|_|0|3|.|s|h|"| |3@1|L|,| |9|7|1|B| @30|1|,|1| @10|T|o|p| 
+|i|s|_|k|o|r|n|s|h|e|l@1|:| |1|,| @40|1|,|1| @10|T|o|p| 
index 762c9ed5165a26b7b6d97840de68bbefc8d66c85..48289913a914060880e379fb1aa14b734b48b250 100644 (file)
@@ -1,4 +1,4 @@
->#+0#0000e05#ffffff0|!|/|b|i|n|/|s|h| +0#0000000&@65
+>#+0#0000e05#ffffff0|!|/|b|i|n|/|d|a|s|h| +0#0000000&@63
 |#+0#0000e05&| |s|h|4| +0#0000000&@69
 |V+0#00e0e07&|a|r|i|a|b|l|e|=+0#0000000&|$+0#e000e06&|{|V|a|r|i|a|b|l|e|B|:+0#af5f00255&|-|{+0#0000000&|V|a|r|i|a|b|l|e|C|}|}+0#e000e06&| +0#0000000&@40
 |V+0#00e0e07&|a|r|i|a|b|l|e|=+0#0000000&|$+0#e000e06&|{|V|a|r|i|a|b|l|e|B|:+0#af5f00255&|-|$+0#e000e06&|{|V|a|r|i|a|b|l|e|C|:+0#af5f00255&|-|{+0#0000000&|V|a|r|3|:|=|e|n|g|}|}+0#e000e06&@1| +0#0000000&@26
@@ -17,4 +17,4 @@
 |:+0#0000e05&| +0#0000000&|$+0#e000e06&|{|V|a|r|i|a|b|l|e|B|:+0#af5f00255&|-|$+0#e000e06&|{|V|a|r|i|a|b|l|e|C|:+0#af5f00255&|-|{+0#0000000&|V|a|r|3|:|=|e|n|g|}|}+0#e000e06&@1| +0#0000000&@33
 |:+0#0000e05&| +0#0000000&|$+0#e000e06&|{|V|a|r|i|a|b|l|e|B|:+0#af5f00255&|=|$+0#e000e06&|{|V|a|r|i|a|b|l|e|C|:+0#af5f00255&|=|{+0#0000000&|V|a|r|3|:|=|$+0#e000e06&|{|V|a|r|4|:+0#af5f00255&|-|e+0#0000000&|n|g|}+0#e000e06&|}+0#0000000&|}+0#e000e06&@1| +0#0000000&@24
 @75
-|"|i|n|p|u|t|/|s|h|_|0|4|.|s|h|"| |2|7|L|,| |9|4|0|B| @30|1|,|1| @10|T|o|p| 
+|i|s|_|d|a|s|h|:| |1|,| |i|s|_|p|o|s|i|x|:| |1|,| |i|s|_|s|h|:| |1|,| @22|1|,|1| @10|T|o|p| 
index a92222950bbaca49f2be2573bf8dc3c9fc9246b8..4e662d559b167324f0ca3423ce1b373d84b31b7e 100644 (file)
@@ -17,4 +17,4 @@
 |V+0#00e0e07&|a|r|i|a|b|l|e|1|=+0#0000000&|$+0#e000e06&|H|O|M|E| +0#0000000&@59
 |V+0#00e0e07&|a|r|i|a|b|l|e|2|=+0#0000000&|'+0#af5f00255&|$+0#e000002&|H|O|M|E|'+0#af5f00255&| +0#0000000&@57
 |V+0#00e0e07&|a|r|i|a|b|l|e|3|=+0#0000000&|"+0#af5f00255&|$+0#e000e06&|H|O|M|E|"+0#af5f00255&| +0#0000000&@57
-|"|i|n|p|u|t|/|s|h|_|0|5|.|s|h|"| |3|7|3|L|,| |1|2|9|5|4|B| @27|1|,|1| @10|T|o|p| 
+|i|s|_|d|a|s|h|:| |1|,| |i|s|_|p|o|s|i|x|:| |1|,| |i|s|_|s|h|:| |1|,| @22|1|,|1| @10|T|o|p| 
index 729159142655095246e6e526f0c612b7c3e20c5b..c037b751eee35af44359d41fd55907f3b5f416cc 100644 (file)
@@ -17,4 +17,4 @@
 |V+0#00e0e07&|a|r|i|a|b|l|e|N|a|m|e|=+0#0000000&|"+0#af5f00255&|$+0#e000e06&|{|B|a|s|i|c|C|o|n|f|i|g|N|a|m|e|}|_+0#e000002&|*|"+0#af5f00255&| +0#0000000&@39
 @75
 |#+0#0000e05&| |E|c|h|o| |s|o|m|e| |k|s|h| |s|p|e|c|i|a|l| |v|a|r|i|a|b|l|e|s| +0#0000000&@41
-|"|i|n|p|u|t|/|s|h|_|0|6|.|s|h|"| |7|1|L|,| |1|6|7@1|B| @29|1|,|1| @10|T|o|p| 
+|i|s|_|k|o|r|n|s|h|e|l@1|:| |1|,| @40|1|,|1| @10|T|o|p| 
index 80d9c6dcd66a2c8cbcb33c29104c234a7ba37633..bf02a6073fbb81e127d244353634a197287d0422 100644 (file)
@@ -1,4 +1,4 @@
->#+0#0000e05#ffffff0|!|/|b|i|n|/|s|h| +0#0000000&@65
+>#+0#0000e05#ffffff0|!|/|b|i|n|/|d|a|s|h| +0#0000000&@63
 |#+0#0000e05&| |T|e|s|t| |f|i|l|e| |t|o| |t|e|s|t| |'|f|o|r| |d|o| |d|o|n|e|'| |l|o@1|p|s|.| +0#0000000&@34
 |#+0#0000e05&| |Y|o|u| |c|a|n| |s|t|a|r|t| |t|h|i|s| |s|c|r|i|p|t| |l|i|k|e|:| |$|0| |{|-|n|e| |-|g|t| |-|l|e| |.@2|}| |(|a|l@1| |n|u|m|e|r|i|c| |o|p|e|r|a|t|o
 |r|s| | +0#0000000&@71
@@ -17,4 +17,4 @@
 |F+0#00e0e07&|u|n|c|t|i|o|n|1| |(|)| |{| +0#0000000&@60
 @75
 |e+0#af5f00255&|c|h|o| +0#e000002&|"+0#af5f00255&|F+0#e000002&|u|n|c|t|i|o|n|1|:| |f|o|r| |l|o@1|p| |i|n|s|i|d|e| |a| |f|u|n|c|t|i|o|n|:|\+0#e000e06&|t|\|c|"+0#af5f00255&| +0#0000000&@25
-|"|i|n|p|u|t|/|s|h|_|0|7|.|s|h|"| |9|3|L|,| |2|3|0|3|B| @29|1|,|1| @10|T|o|p| 
+|i|s|_|d|a|s|h|:| |1|,| |i|s|_|p|o|s|i|x|:| |1|,| |i|s|_|s|h|:| |1|,| @22|1|,|1| @10|T|o|p| 
index abe0d4ea1bae6d1f1efa7bd168203dced0f0284f..9be018a85d3be1ea85146296346076a6cf3de3c0 100644 (file)
@@ -17,4 +17,4 @@
 |#+0#0000e05&| |C|a|s|e| |1|b|.| |V|a|r|i|a|b|l|e| |a|n|d| |C|o|n|s|t|a|n|t| +0#0000000&@42
 |[+0#af5f00255&| +0#0000000&|-+0#af5f00255&|t| +0#0000000&|0+0#e000002&| +0#0000000&|]+0#af5f00255&| +0#0000000&|&@1| |e+0#af5f00255&|c|h|o| +0#e000002&|"+0#af5f00255&|\+0#e000e06&|n|`|d|a|t|e|`|"+0#af5f00255&| +0#e000002&|&+0#0000000&@1| |u+0#af5f00255&|n|s|e|t| +0#00e0e07&|V|a|r|i|a|b|l|e|A| +0#0000000&@28
 |V+0#00e0e07&|a|r|i|a|b|l|e|1|=+0#0000000&|$+0#e000e06&|{|V|a|r|i|a|b|l|e|A|:+0#af5f00255&|-|$+0#e000e06&|H|O|M|E| +0#0000000&|T|h|i|s| |i|s| |a| |T|e|x|t|}+0#e000e06&| +0#0000000&@30
-|"|i|n|p|u|t|/|s|h|_|0|8|.|s|h|"| |8|2|L|,| |2|9@1|3|B| @29|1|,|1| @10|T|o|p| 
+|i|s|_|k|o|r|n|s|h|e|l@1|:| |1|,| @40|1|,|1| @10|T|o|p| 
index e881c2947e6f53cd95b169b69d95e8298524bdcf..8a51f394602299ef7178cc8ed80d465afad1aa37 100644 (file)
@@ -1,4 +1,4 @@
->#+0#0000e05#ffffff0|!|/|b|i|n|/|s|h| +0#0000000&@65
+>#+0#0000e05#ffffff0|!|/|b|i|n|/|d|a|s|h| +0#0000000&@63
 |#+0#0000e05&| |T|e|s|t| |f|i|l|e| |f|o|r| |v|i|m| |t|h|e| |c|h|e|c|k| |(|)| |s|u|b|s|h|e|l@1|s| +0#0000000&@32
 |(+0#e000e06&| |c+0#af5f00255&|d| +0#e000e06&|;+0#af5f00255&| +0#e000e06&|$|p|w|d| |)| +0#0000000&||| |w|c| |-+0#e000e06&|c| +0#0000000&@53
 |(+0#e000e06&| |c+0#af5f00255&|d| +0#e000e06&|$|1| |;+0#af5f00255&| +0#e000e06&|$|p|w|d| |)| +0#0000000&||| |w|c| |-+0#e000e06&|c| +0#0000000&@50
@@ -17,4 +17,4 @@
 |(+0#e000e06&| |c+0#af5f00255&|d| +0#e000e06&|$|{|H|O|M|E|}| |)| +0#0000000&||| |w|c| |-+0#e000e06&|c| +0#0000000&@52
 |(|(+0#e000e06&|n+0#00e0e07&|=+0#0000000&|1+0#e000002&|+|2|)+0#e000e06&|)+0#ffffff16#ff404010| +0#0000000#ffffff0@65
 |l+0#af5f00255&|e|t| +0#0000000&|n+0#00e0e07&|=+0#0000000&|1+0#e000002&|++0#0000000&|2+0#e000002&| +0#0000000&@65
-|"|i|n|p|u|t|/|s|h|_|0|9|.|s|h|"| |1|9|L|,| |4|8|3|B| @30|1|,|1| @10|A|l@1| 
+|i|s|_|d|a|s|h|:| |1|,| |i|s|_|p|o|s|i|x|:| |1|,| |i|s|_|s|h|:| |1|,| @22|1|,|1| @10|A|l@1| 
index 2281ea9fa530f162773dfbd6e0940baf949cced9..b97cfa3955b026bc0859c0c4e170674dc566f6ce 100644 (file)
@@ -1,4 +1,4 @@
-|#+0#0000e05#ffffff0|!|/|b|i|n|/|s|h| +0#0000000&@65
+|#+0#0000e05#ffffff0|!|/|b|i|n|/|d|a|s|h| +0#0000000&@63
 |#+0#0000e05&| |T|e|s|t| |f|i|l|e| |f|o|r| |v|i|m| |t|h|e| |c|h|e|c|k| |(|)| |s|u|b|s|h|e|l@1|s| +0#0000000&@32
 |(+0#e000e06&| |c+0#af5f00255&|d| +0#e000e06&|;+0#af5f00255&| +0#e000e06&|$|p|w|d| |)| +0#0000000&||| |w|c| |-+0#e000e06&|c| +0#0000000&@53
 |(+0#e000e06&| |c+0#af5f00255&|d| +0#e000e06&|$|1| |;+0#af5f00255&| +0#e000e06&|$|p|w|d| |)| +0#0000000&||| |w|c| |-+0#e000e06&|c| +0#0000000&@50
@@ -17,4 +17,4 @@
 |(+0#e000e06&| |c+0#af5f00255&|d| +0#e000e06&|$|{|H|O|M|E|}| |)| +0#0000000&||| |w|c| |-+0#e000e06&|c| +0#0000000&@52
 |(|(+0#e000e06&|n+0#00e0e07&|=+0#0000000&|1+0#e000002&|+|2|)+0#e000e06&|)+0#ffffff16#ff404010| +0#0000000#ffffff0@65
 >l+0#af5f00255&|e|t| +0#0000000&|n+0#00e0e07&|=+0#0000000&|1+0#e000002&|++0#0000000&|2+0#e000002&| +0#0000000&@65
-|"|i|n|p|u|t|/|s|h|_|0|9|.|s|h|"| |1|9|L|,| |4|8|3|B| @30|1|9|,|1| @9|A|l@1| 
+|:|r|e|d|r|a|w| @49|1|9|,|1| @9|A|l@1| 
index 2d4f6e811217b81d999b9d6c287cf14578690004..bd27c99bded9e4b835e21dfda3db02f810e192bc 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/dash
 export `echo 'A=B'`
 printenv A
 echo a `#foo` b
index 5c6ab04ce5c22b37c9fb39f5c1458fdb91fa1caf..e9ec5fedb7db4401e059b65ca07a0c53a0c07e18 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/dash
 # sh4
 Variable=${VariableB:-{VariableC}}
 Variable=${VariableB:-${VariableC:-{Var3:=eng}}}
index 6fc4931765b57b4769ed99df2f516c1894e5287e..0e74227bc11a18719efdc74b3804c09089164f2c 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/dash
 # Test file to test 'for do done' loops.
 # You can start this script like: $0 {-ne -gt -le ...} (all numeric operators 
 # are allowed!
index 9888ade98b150bdf9c568137542fda8ecba27f25..e736e06b64da7e07e3affedaafca084021ff2805 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/dash
 # Test file for vim the check () subshells
 ( cd ; $pwd ) | wc -c
 ( cd $1 ; $pwd ) | wc -c
index 55e874c7d6d7afa5596a91ff743c4b4e9a10761f..2603a52da074b92e4b05fa7449a8dc5d458940fb 100644 (file)
@@ -85,7 +85,6 @@ func HandleSwapExists()
   endif
 endfunc
 
-
 let ok_count = 0
 let failed_tests = []
 let skipped_count = 0
@@ -115,6 +114,28 @@ for fname in glob('input/*.*', 1, 1)
 
     let lines =<< trim END
       syntax on
+
+      " extra info for shell variables
+      func ShellInfo()
+       let msg = ''
+       for [key, val] in items(b:)
+         if key =~ '^is_'
+           let msg ..= key .. ': ' .. val .. ', '
+         endif
+       endfor
+       if msg != ''
+         echomsg msg
+       endif
+      endfunc
+
+      au! SwapExists * call HandleSwapExists()
+      func HandleSwapExists()
+       " Ignore finding a swap file for the test input, the user might be
+       " editing it and that's OK.
+       if expand('<afile>') =~ 'input[/\\].*\..*'
+         let v:swapchoice = 'e'
+       endif
+      endfunc
     END
     call writefile(lines, 'Xtestscript')
 
@@ -127,13 +148,24 @@ for fname in glob('input/*.*', 1, 1)
     " for the terminal window.
     redraw
 
-    let buf = RunVimInTerminal('-S Xtestscript ' .. fname, {})
+    let buf = RunVimInTerminal('-S Xtestscript', {})
+    " edit the file only after catching the SwapExists event
+    call term_sendkeys(buf, ":edit " .. fname .. "\<CR>")
+
+    if filetype == 'sh'
+      call term_sendkeys(buf, ":call ShellInfo()\<CR>")
+    endif
 
-    " Screendump at the start of the file: failed/filetype_00.dump
+    " Screendump at the start of the file: failed/root_00.dump
     let root_00 = root .. '_00'
     call ch_log('First screendump for ' .. fname .. ': failed/' .. root_00 .. '.dump')
     let fail = VerifyScreenDump(buf, root_00, {})
 
+    " clear the shell info if there are not enough lines to cause a scroll
+    if filetype == 'sh' && linecount <= 19
+      call term_sendkeys(buf, ":redraw\<CR>")
+    endif
+
     " Make a Screendump every 18 lines of the file: failed/root_NN.dump
     let topline = 1
     let nr = 1
index fed49d9584556768325f8c404ff48a14dd133fea..535afe777c026e18c58d498fce2d3aacf6dcb8f2 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1656,
 /**/
     1655,
 /**/