diff options
Diffstat (limited to 'tests/winPipe.test')
-rw-r--r-- | tests/winPipe.test | 78 |
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) |