Fossil SCM

Added more test cases to test-spawn-* and gave the test cases human-readable names rather than numbers.

wyoung 2021-06-21 23:03 fossil-spawn
Commit 27cdcbbb497dc36964884b09d6c62a8c5a94f78a295785882c92c155c3168ed4
1 file changed +12 -5
--- test/cmdline.test
+++ test/cmdline.test
@@ -54,20 +54,27 @@
5454
# Now do similar things with the new "spawn" mechanism, checking whether
5555
# args passed through a potential double interpretation call sequence do
5656
# not in fact get double-interpreted.
5757
5858
proc spawn {args} {
59
- set i 1
60
- foreach arg $args {
59
+ foreach {arg testname} $args {
6160
fossil test-fossil-spawn $arg
62
- test spawn-echo.$i \
61
+ test spawn-echo-$testname \
6362
{[lrange [split $::RESULT \n] 3 end]=="\{argv\[2\] = \[$arg\]\}"}
64
- incr i
6563
}
6664
}
6765
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
6976
7077
7178
###############################################################################
7279
7380
test_cleanup
7481
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button