File: tests_env_env-S.pl.patch

package info (click to toggle)
rust-coreutils 0.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 485,976 kB
  • sloc: ansic: 103,608; asm: 28,570; sh: 8,672; python: 5,662; makefile: 474; cpp: 97; javascript: 72
file content (61 lines) | stat: -rw-r--r-- 3,540 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Index: gnu/tests/env/env-S.pl
===================================================================
--- gnu.orig/tests/env/env-S.pl
+++ gnu/tests/env/env-S.pl
@@ -200,36 +200,37 @@ my @Tests =

      # Test Error Conditions
      ['err1', q[-S'"\\c"'], {EXIT=>125},
-      {ERR=>"$prog: '\\c' must not appear in double-quoted -S string\n"}],
+      {ERR=>"$prog: '\\c' must not appear in double-quoted -S string at position 2\n"}],
      ['err2', q[-S'A=B\\'], {EXIT=>125},
-      {ERR=>"$prog: invalid backslash at end of string in -S\n"}],
+      {ERR=>"$prog: invalid backslash at end of string in -S at position 4 in context Unquoted\n"}],
      ['err3', q[-S'"A=B\\"'], {EXIT=>125},
-      {ERR=>"$prog: no terminating quote in -S string\n"}],
+      {ERR=>"$prog: no terminating quote in -S string at position 6 for quote '\"'\n"}],
      ['err4', q[-S"'A=B\\\\'"], {EXIT=>125},
-      {ERR=>"$prog: no terminating quote in -S string\n"}],
+      {ERR=>"$prog: no terminating quote in -S string at position 6 for quote '''\n"}],
      ['err5', q[-S'A=B\\q'], {EXIT=>125},
-      {ERR=>"$prog: invalid sequence '\\q' in -S\n"}],
-     ['err6', q[-S'A=$B'], {EXIT=>125},
-      {ERR=>"$prog: only \${VARNAME} expansion is supported, error at: \$B\n"}],
+      {ERR=>"$prog: invalid sequence '\\q' in -S at position 4\n"}],
+     ['err6', q[-S'A=$B echo hello'], {EXIT=>0},
+      {OUT=>"hello"}],
      ['err7', q[-S'A=${B'], {EXIT=>125},
-      {ERR=>"$prog: only \${VARNAME} expansion is supported, " .
-           "error at: \${B\n"}],
+      {ERR=>"$prog" . qq[: variable name issue (at 5): Missing closing brace at position 5\n]}],
      ['err8', q[-S'A=${B%B}'], {EXIT=>125},
-      {ERR=>"$prog: only \${VARNAME} expansion is supported, " .
-           "error at: \${B%B}\n"}],
+      {ERR=>"$prog" . qq[: variable name issue (at 5): Unexpected character: '%', expected a closing brace ('}') or colon (':') at position 5\n]}],
      ['err9', q[-S'A=${9B}'], {EXIT=>125},
-      {ERR=>"$prog: only \${VARNAME} expansion is supported, " .
-           "error at: \${9B}\n"}],
+      {ERR=>"$prog" . qq[: variable name issue (at 4): Unexpected character: '9', expected variable name must not start with 0..9 at position 4\n]}],

      # Test incorrect shebang usage (extraneous whitespace).
      ['err_sp2', q['-v -S cat -n'], {EXIT=>125},
-      {ERR=>"env: invalid option -- ' '\n" .
-            "env: use -[v]S to pass options in shebang lines\n" .
-           "Try 'env --help' for more information.\n"}],
+      {ERR=>"error: unexpected argument '- ' found\n\n" .
+            "  tip: to pass '- ' as a value, use '-- - '\n\n" .
+            "Usage: $prog [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n\n" .
+            "For more information, try '--help'.\n" .
+            "$prog: use -[v]S to pass options in shebang lines\n"}],
      ['err_sp3', q['-v	-S cat -n'], {EXIT=>125}, # embedded tab after -v
-      {ERR=>"env: invalid option -- '\t'\n" .
-            "env: use -[v]S to pass options in shebang lines\n" .
-           "Try 'env --help' for more information.\n"}],
+      {ERR=>"error: unexpected argument '-\t' found\n\n" .
+            "  tip: to pass '-\t' as a value, use '-- -\t'\n\n" .
+            "Usage: $prog [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n\n" .
+            "For more information, try '--help'.\n" .
+            "$prog: use -[v]S to pass options in shebang lines\n"}],

      # Also diagnose incorrect shebang usage when failing to exec.
      # This typically happens with: