Fossil SCM
Added more test cases to test-spawn-* and gave the test cases human-readable names rather than numbers.
Commit
27cdcbbb497dc36964884b09d6c62a8c5a94f78a295785882c92c155c3168ed4
Parent
fb7c5797365ee55…
1 file changed
+12
-5
+12
-5
| --- test/cmdline.test | ||
| +++ test/cmdline.test | ||
| @@ -54,20 +54,27 @@ | ||
| 54 | 54 | # Now do similar things with the new "spawn" mechanism, checking whether |
| 55 | 55 | # args passed through a potential double interpretation call sequence do |
| 56 | 56 | # not in fact get double-interpreted. |
| 57 | 57 | |
| 58 | 58 | proc spawn {args} { |
| 59 | - set i 1 | |
| 60 | - foreach arg $args { | |
| 59 | + foreach {arg testname} $args { | |
| 61 | 60 | fossil test-fossil-spawn $arg |
| 62 | - test spawn-echo.$i \ | |
| 61 | + test spawn-echo-$testname \ | |
| 63 | 62 | {[lrange [split $::RESULT \n] 3 end]=="\{argv\[2\] = \[$arg\]\}"} |
| 64 | - incr i | |
| 65 | 63 | } |
| 66 | 64 | } |
| 67 | 65 | |
| 68 | -spawn "a" "bx" {$SHELL} {$(ls)} "%COMSPEC%" "Jörg's “Development” Job Offer" | |
| 66 | +spawn \ | |
| 67 | + "a" single-char \ | |
| 68 | + "b x" space-separated-single-chars \ | |
| 69 | + "b ; c & x" chained-commands \ | |
| 70 | + {* ? [a-z]*} wildcards \ | |
| 71 | + {$SHELL} posix-shell-variable \ | |
| 72 | + "%COMSPEC%" cmd-exe-shell-variable \ | |
| 73 | + {$(ls)} subshell-invocation \ | |
| 74 | + {"Bill's Birthday"} quotes-and-spaces \ | |
| 75 | + "Jörg's “Development” Job Offer" spaces-and-unicode | |
| 69 | 76 | |
| 70 | 77 | |
| 71 | 78 | ############################################################################### |
| 72 | 79 | |
| 73 | 80 | test_cleanup |
| 74 | 81 |
| --- test/cmdline.test | |
| +++ test/cmdline.test | |
| @@ -54,20 +54,27 @@ | |
| 54 | # Now do similar things with the new "spawn" mechanism, checking whether |
| 55 | # args passed through a potential double interpretation call sequence do |
| 56 | # not in fact get double-interpreted. |
| 57 | |
| 58 | proc spawn {args} { |
| 59 | set i 1 |
| 60 | foreach arg $args { |
| 61 | fossil test-fossil-spawn $arg |
| 62 | test spawn-echo.$i \ |
| 63 | {[lrange [split $::RESULT \n] 3 end]=="\{argv\[2\] = \[$arg\]\}"} |
| 64 | incr i |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | spawn "a" "bx" {$SHELL} {$(ls)} "%COMSPEC%" "Jörg's “Development” Job Offer" |
| 69 | |
| 70 | |
| 71 | ############################################################################### |
| 72 | |
| 73 | test_cleanup |
| 74 |
| --- test/cmdline.test | |
| +++ test/cmdline.test | |
| @@ -54,20 +54,27 @@ | |
| 54 | # Now do similar things with the new "spawn" mechanism, checking whether |
| 55 | # args passed through a potential double interpretation call sequence do |
| 56 | # not in fact get double-interpreted. |
| 57 | |
| 58 | proc spawn {args} { |
| 59 | foreach {arg testname} $args { |
| 60 | fossil test-fossil-spawn $arg |
| 61 | test spawn-echo-$testname \ |
| 62 | {[lrange [split $::RESULT \n] 3 end]=="\{argv\[2\] = \[$arg\]\}"} |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | spawn \ |
| 67 | "a" single-char \ |
| 68 | "b x" space-separated-single-chars \ |
| 69 | "b ; c & x" chained-commands \ |
| 70 | {* ? [a-z]*} wildcards \ |
| 71 | {$SHELL} posix-shell-variable \ |
| 72 | "%COMSPEC%" cmd-exe-shell-variable \ |
| 73 | {$(ls)} subshell-invocation \ |
| 74 | {"Bill's Birthday"} quotes-and-spaces \ |
| 75 | "Jörg's “Development” Job Offer" spaces-and-unicode |
| 76 | |
| 77 | |
| 78 | ############################################################################### |
| 79 | |
| 80 | test_cleanup |
| 81 |