summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2004-02-01 09:37:49 (GMT)
committerdavygrvy <davygrvy@pobox.com>2004-02-01 09:37:49 (GMT)
commite131c70a9234181716abcc8e7ae32a2bc3a42217 (patch)
tree9cec7739c8b28e65aeeee0a14e5e9d1154b5c1cf /tests
parente8861e19ed8855fd8a90047d4e78f8f659aad9fd (diff)
downloadtcl-e131c70a9234181716abcc8e7ae32a2bc3a42217.zip
tcl-e131c70a9234181716abcc8e7ae32a2bc3a42217.tar.gz
tcl-e131c70a9234181716abcc8e7ae32a2bc3a42217.tar.bz2
* tests/winPipe.test: more pass-thru commandline verifications.
* win/tclWinPipe.c (BuildCommandLine): Special case quoting for '{' not required by the c-runtimes's _setargv(). * win/tclAppInit.c: Removed our custom setargv() in favor of the one provided by the c-runtime. [Bug 672938]
Diffstat (limited to 'tests')
-rw-r--r--tests/winPipe.test78
1 files changed, 73 insertions, 5 deletions
diff --git a/tests/winPipe.test b/tests/winPipe.test
index 26a7e33..51b26ef 100644
--- a/tests/winPipe.test
+++ b/tests/winPipe.test
@@ -12,7 +12,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: winPipe.test,v 1.22 2002/12/17 02:47:39 davygrvy Exp $
+# RCS: @(#) $Id: winPipe.test,v 1.23 2004/02/01 09:37:49 davygrvy Exp $
package require tcltest
namespace import -force ::tcltest::*
@@ -315,12 +315,80 @@ set path(echoArgs.tcl) [makeFile {
puts "[list $argv0 $argv]"
} echoArgs.tcl]
+
+### validate the raw output of BuildCommandLine().
+###
test winpipe-7.1 {BuildCommandLine: null arguments} {pcOnly exec} {
- exec [interpreter] $path(echoArgs.tcl) foo "" bar
-} [list $path(echoArgs.tcl) {foo {} bar}]
+ exec $env(COMSPEC) /c echo foo "" bar
+} {foo "" bar}
test winpipe-7.2 {BuildCommandLine: null arguments} {pcOnly exec} {
- exec [interpreter] $path(echoArgs.tcl) foo \" bar
-} [list $path(echoArgs.tcl) {foo {"} bar}]
+ exec $env(COMSPEC) /c echo foo {} bar
+} {foo "" bar}
+test winpipe-7.3 {BuildCommandLine: dbl quote quoting #1} {pcOnly exec} {
+ exec $env(COMSPEC) /c echo foo {"} bar
+} {foo \" bar}
+test winpipe-7.4 {BuildCommandLine: dbl quote quoting #2} {pcOnly exec} {
+ exec $env(COMSPEC) /c echo foo {""} bar
+} {foo \"\" bar}
+test winpipe-7.5 {BuildCommandLine: dbl quote quoting #3} {pcOnly exec} {
+ exec $env(COMSPEC) /c echo foo {" } bar
+} {foo "\" " bar}
+test winpipe-7.6 {BuildCommandLine: dbl quote quoting #4} {pcOnly exec} {
+ exec $env(COMSPEC) /c echo foo {a="b"} bar
+} {foo a=\"b\" bar}
+test winpipe-7.7 {BuildCommandLine: dbl quote quoting #5} {pcOnly exec} {
+ exec $env(COMSPEC) /c echo foo {a = "b"} bar
+} {foo "a = \"b\"" bar}
+test winpipe-7.8 {BuildCommandLine: dbl quote quoting #6} {pcOnly exec} {
+ exec $env(COMSPEC) /c echo {"hello"} {""hello""} {"""hello"""} {"\"hello\""} {he llo} {he " llo}
+} {\"hello\" \"\"hello\"\" \"\"\"hello\"\"\" \"\\\"hello\\\"\" "he llo" "he \" llo"}
+test winpipe-7.9 {BuildCommandLine: special chars #1} {pcOnly exec} {
+ exec $env(COMSPEC) /c echo foo \\ bar
+} "foo \\ bar"
+test winpipe-7.10 {BuildCommandLine: special chars #2} {pcOnly exec} {
+ exec $env(COMSPEC) /c echo foo \{ bar
+} "foo \{ bar"
+test winpipe-7.11 {BuildCommandLine: special chars #3} {pcOnly exec} {
+ exec $env(COMSPEC) /c echo foo \} bar
+} "foo \} bar"
+
+### validate the pass-thru from BuildCommandLine() to the crt's setargv().
+###
+test winpipe-8.1 {BuildCommandLine/setargv pass-thru: null arguments} {pcOnly exec} {
+ exec [interpreter] $path(echoArgs.tcl) foo "" bar
+} [list $path(echoArgs.tcl) [list foo {} bar]]
+test winpipe-8.2 {BuildCommandLine/setargv pass-thru: null arguments} {pcOnly exec} {
+ exec [interpreter] $path(echoArgs.tcl) foo {} bar
+} [list $path(echoArgs.tcl) [list foo {} bar]]
+test winpipe-8.3 {BuildCommandLine/setargv pass-thru: dbl quote quoting #1} {pcOnly exec} {
+ exec [interpreter] $path(echoArgs.tcl) foo {"} bar
+} [list $path(echoArgs.tcl) [list foo {"} bar]]
+test winpipe-8.4 {BuildCommandLine/setargv pass-thru: dbl quote quoting #2} {pcOnly exec} {
+ exec [interpreter] $path(echoArgs.tcl) foo {""} bar
+} [list $path(echoArgs.tcl) [list foo {""} bar]]
+test winpipe-8.5 {BuildCommandLine/setargv pass-thru: dbl quote quoting #3} {pcOnly exec} {
+ exec [interpreter] $path(echoArgs.tcl) foo {" } bar
+} [list $path(echoArgs.tcl) [list foo {" } bar]]
+test winpipe-8.6 {BuildCommandLine/setargv pass-thru: dbl quote quoting #4} {pcOnly exec} {
+ exec [interpreter] $path(echoArgs.tcl) foo {a="b"} bar
+} [list $path(echoArgs.tcl) [list foo {a="b"} bar]]
+test winpipe-8.7 {BuildCommandLine/setargv pass-thru: dbl quote quoting #5} {pcOnly exec} {
+ exec [interpreter] $path(echoArgs.tcl) foo {a = "b"} bar
+} [list $path(echoArgs.tcl) [list foo {a = "b"} bar]]
+test winpipe-8.8 {BuildCommandLine/setargv pass-thru: dbl quote quoting #6} {pcOnly exec} {
+ exec [interpreter] $path(echoArgs.tcl) {"hello"} {""hello""} {"""hello"""} {"\"hello\""} {he llo}
+} [list $path(echoArgs.tcl) [list {"hello"} {""hello""} {"""hello"""} {"\"hello\""} {he llo}]]
+test winpipe-8.9 {BuildCommandLine/setargv pass-thru: special chars #1} {pcOnly exec} {
+ exec [interpreter] $path(echoArgs.tcl) foo \\ bar
+} [list $path(echoArgs.tcl) [list foo \\ bar]]
+test winpipe-8.10 {BuildCommandLine/setargv pass-thru: special chars #2} {pcOnly exec} {
+ exec [interpreter] $path(echoArgs.tcl) foo \{ bar
+} [list $path(echoArgs.tcl) [list foo \{ bar]]
+test winpipe-8.11 {BuildCommandLine/setargv pass-thru: special chars #3} {pcOnly exec} {
+ exec [interpreter] $path(echoArgs.tcl) foo \} bar
+} [list $path(echoArgs.tcl) [list foo \} bar]]
+
+
# restore old values for env(TMP) and env(TEMP)