Browse Source

tests: add support of multi-line diagnostics to check_h

* tests/syntax.sh (check_h): Add support of multi-line diagnostics.
Dmitry V. Levin 1 month ago
parent
commit
da86a83867
1 changed files with 9 additions and 5 deletions
  1. 9
    5
      tests/syntax.sh

+ 9
- 5
tests/syntax.sh View File

@@ -50,10 +50,14 @@ __EOF__
50 50
 
51 51
 check_h()
52 52
 {
53
-	local pattern="$1"; shift
54
-	cat > "$EXP" << __EOF__
55
-$STRACE_EXE: $pattern
56
-Try '$STRACE_EXE -h' for more information.
57
-__EOF__
53
+	local patterns="$1"; shift
54
+	{
55
+		local pattern
56
+		printf '%s\n' "$patterns" |
57
+			while read -r pattern; do
58
+				printf '%s: %s\n' "$STRACE_EXE" "$pattern"
59
+			done
60
+		printf "Try '%s -h' for more information.\\n" "$STRACE_EXE"
61
+	} > "$EXP"
58 62
 	check_exit_status_and_stderr "$@"
59 63
 }

Loading…
Cancel
Save