os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/winPipe.test
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
# 
sl@0
     2
# winPipe.test --
sl@0
     3
#
sl@0
     4
# This file contains a collection of tests for tclWinPipe.c
sl@0
     5
#
sl@0
     6
# Sourcing this file into Tcl runs the tests and generates output for 
sl@0
     7
# errors.  No output means no errors were found.
sl@0
     8
#
sl@0
     9
# Copyright (c) 1996 Sun Microsystems, Inc.
sl@0
    10
# Copyright (c) 1998-1999 by Scriptics Corporation.
sl@0
    11
#
sl@0
    12
# See the file "license.terms" for information on usage and redistribution
sl@0
    13
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
sl@0
    14
#
sl@0
    15
# RCS: @(#) $Id: winPipe.test,v 1.22.2.4 2005/04/20 00:14:54 hobbs Exp $
sl@0
    16
sl@0
    17
package require tcltest
sl@0
    18
namespace import -force ::tcltest::*
sl@0
    19
unset -nocomplain path
sl@0
    20
sl@0
    21
testConstraint exec [llength [info commands exec]]
sl@0
    22
sl@0
    23
set bindir [file join [pwd] [file dirname [info nameofexecutable]]]
sl@0
    24
set cat32 [file join $bindir cat32.exe]
sl@0
    25
sl@0
    26
set ::tcltest::testConstraints(cat32) [file exists $cat32]
sl@0
    27
sl@0
    28
if {[catch {puts console1 ""}]} {
sl@0
    29
    set ::tcltest::testConstraints(AllocConsole) 1
sl@0
    30
} else {
sl@0
    31
    set ::tcltest::testConstraints(.console) 1
sl@0
    32
}
sl@0
    33
sl@0
    34
set big bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n
sl@0
    35
append big $big
sl@0
    36
append big $big	
sl@0
    37
append big $big
sl@0
    38
append big $big
sl@0
    39
append big $big
sl@0
    40
append big $big
sl@0
    41
sl@0
    42
set path(little) [makeFile {} little]
sl@0
    43
set f [open $path(little) w] 
sl@0
    44
puts -nonewline $f "little"
sl@0
    45
close $f
sl@0
    46
sl@0
    47
set path(big) [makeFile {} big]
sl@0
    48
set f [open $path(big) w]
sl@0
    49
puts -nonewline $f $big
sl@0
    50
close $f
sl@0
    51
sl@0
    52
proc contents {file} {
sl@0
    53
    set f [open $file r]
sl@0
    54
    set r [read $f]
sl@0
    55
    close $f
sl@0
    56
    set r
sl@0
    57
}
sl@0
    58
sl@0
    59
set path(more) [makeFile {
sl@0
    60
    while {[eof stdin] == 0} {
sl@0
    61
	puts -nonewline [read stdin]
sl@0
    62
    }
sl@0
    63
} more]
sl@0
    64
sl@0
    65
set path(stdout) [makeFile {} stdout]
sl@0
    66
set path(stderr) [makeFile {} stderr]
sl@0
    67
sl@0
    68
test winpipe-1.1 {32 bit comprehensive tests: from little file} {pcOnly exec cat32} {
sl@0
    69
    exec $cat32 < $path(little) > $path(stdout) 2> $path(stderr)
sl@0
    70
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
    71
} {little stderr32}
sl@0
    72
test winpipe-1.2 {32 bit comprehensive tests: from big file} {pcOnly exec cat32} {
sl@0
    73
    exec $cat32 < $path(big) > $path(stdout) 2> $path(stderr)
sl@0
    74
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
    75
} "{$big} stderr32"
sl@0
    76
test winpipe-1.3 {32 bit comprehensive tests: a little from pipe} {pcOnly nt exec cat32} {
sl@0
    77
    exec [interpreter] more < little | $cat32 > $path(stdout) 2> $path(stderr)
sl@0
    78
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
    79
} {little stderr32}
sl@0
    80
test winpipe-1.4 {32 bit comprehensive tests: a lot from pipe} {pcOnly nt exec cat32} {
sl@0
    81
    exec [interpreter] more < big | $cat32 > $path(stdout) 2> $path(stderr)
sl@0
    82
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
    83
} "{$big} stderr32"
sl@0
    84
test winpipe-1.5 {32 bit comprehensive tests: a lot from pipe} {pcOnly 95 exec cat32} {
sl@0
    85
    exec command /c type big |& $cat32 > $path(stdout) 2> $path(stderr)
sl@0
    86
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
    87
} "{$big} stderr32"
sl@0
    88
test winpipe-1.6 {32 bit comprehensive tests: from console} \
sl@0
    89
	{pcOnly cat32 AllocConsole} {
sl@0
    90
    # would block waiting for human input
sl@0
    91
} {}
sl@0
    92
test winpipe-1.7 {32 bit comprehensive tests: from NUL} {pcOnly exec cat32} {
sl@0
    93
    exec $cat32 < nul > $path(stdout) 2> $path(stderr)
sl@0
    94
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
    95
} {{} stderr32}
sl@0
    96
test winpipe-1.8 {32 bit comprehensive tests: from socket} {pcOnly cat32} {
sl@0
    97
    # doesn't work
sl@0
    98
} {}
sl@0
    99
test winpipe-1.9 {32 bit comprehensive tests: from nowhere} \
sl@0
   100
	{pcOnly exec cat32 .console} {
sl@0
   101
    exec $cat32 > $path(stdout) 2> $path(stderr)
sl@0
   102
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
   103
} {{} stderr32}
sl@0
   104
test winpipe-1.10 {32 bit comprehensive tests: from file handle} \
sl@0
   105
	{pcOnly exec cat32} {
sl@0
   106
    set f [open $path(little) r]
sl@0
   107
    exec $cat32 <@$f > $path(stdout) 2> $path(stderr)
sl@0
   108
    close $f
sl@0
   109
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
   110
} {little stderr32}
sl@0
   111
test winpipe-1.11 {32 bit comprehensive tests: read from application} \
sl@0
   112
	{pcOnly exec cat32} {
sl@0
   113
    set f [open "|[list $cat32] < $path(little)" r]
sl@0
   114
    gets $f line
sl@0
   115
    catch {close $f} msg
sl@0
   116
    list $line $msg
sl@0
   117
} {little stderr32}
sl@0
   118
test winpipe-1.12 {32 bit comprehensive tests: a little to file} \
sl@0
   119
	{pcOnly exec cat32} {
sl@0
   120
    exec $cat32 < $path(little) > $path(stdout) 2> $path(stderr)
sl@0
   121
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
   122
} {little stderr32}
sl@0
   123
test winpipe-1.13 {32 bit comprehensive tests: a lot to file} \
sl@0
   124
	{pcOnly exec cat32} {
sl@0
   125
    exec $cat32 < $path(big) > $path(stdout) 2> $path(stderr)
sl@0
   126
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
   127
} "{$big} stderr32"
sl@0
   128
test winpipe-1.14 {32 bit comprehensive tests: a little to pipe} \
sl@0
   129
	{pcOnly exec stdio cat32} {
sl@0
   130
    exec $cat32 < $path(little) | [interpreter] $path(more) > $path(stdout) 2> $path(stderr)
sl@0
   131
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
   132
} {little stderr32}
sl@0
   133
test winpipe-1.15 {32 bit comprehensive tests: a lot to pipe} \
sl@0
   134
	{pcOnly exec stdio cat32} {
sl@0
   135
    exec $cat32 < $path(big) | [interpreter] $path(more) > $path(stdout) 2> $path(stderr)
sl@0
   136
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
   137
} "{$big} stderr32"
sl@0
   138
test winpipe-1.16 {32 bit comprehensive tests: to console} {pcOnly exec cat32} {
sl@0
   139
    catch {exec $cat32 << "You should see this\n" >@stdout} msg
sl@0
   140
    set msg
sl@0
   141
} stderr32
sl@0
   142
test winpipe-1.17 {32 bit comprehensive tests: to NUL} {pcOnly exec cat32} {
sl@0
   143
    # some apps hang when sending a large amount to NUL.  $cat32 isn't one.
sl@0
   144
    catch {exec $cat32 < $path(big) > nul} msg
sl@0
   145
    set msg
sl@0
   146
} stderr32
sl@0
   147
test winpipe-1.18 {32 bit comprehensive tests: to nowhere} \
sl@0
   148
	{pcOnly exec cat32 .console} {
sl@0
   149
    exec $cat32 < $path(big) >&@stdout 
sl@0
   150
} {}
sl@0
   151
test winpipe-1.19 {32 bit comprehensive tests: to file handle} {pcOnly exec cat32} {
sl@0
   152
    set f1 [open $path(stdout) w]
sl@0
   153
    set f2 [open $path(stderr) w]
sl@0
   154
    exec $cat32 < $path(little) >@$f1 2>@$f2
sl@0
   155
    close $f1
sl@0
   156
    close $f2
sl@0
   157
    list [contents $path(stdout)] [contents $path(stderr)]
sl@0
   158
} {little stderr32}
sl@0
   159
test winpipe-1.20 {32 bit comprehensive tests: write to application} \
sl@0
   160
	{pcOnly exec cat32} {
sl@0
   161
    set f [open |[list $cat32 >$path(stdout)] w]
sl@0
   162
    puts -nonewline $f "foo"
sl@0
   163
    catch {close $f} msg
sl@0
   164
    list [contents $path(stdout)] $msg
sl@0
   165
} {foo stderr32}
sl@0
   166
test winpipe-1.21 {32 bit comprehensive tests: read/write application} \
sl@0
   167
	{pcOnly exec cat32} {
sl@0
   168
    set f [open "|[list $cat32]" r+]
sl@0
   169
    puts $f $big
sl@0
   170
    puts $f \032
sl@0
   171
    flush $f
sl@0
   172
    set r [read $f 64]
sl@0
   173
    catch {close $f}
sl@0
   174
    set r
sl@0
   175
} "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
sl@0
   176
test winpipe-1.22 {Checking command.com for Win95/98 hanging} {pcOnly 95 exec} {
sl@0
   177
    exec command.com /c dir /b
sl@0
   178
    set result 1
sl@0
   179
} 1
sl@0
   180
file delete more
sl@0
   181
sl@0
   182
test winpipe-4.1 {Tcl_WaitPid} {pcOnly nt exec cat32} {
sl@0
   183
    proc readResults {f} {
sl@0
   184
	global x result
sl@0
   185
	if { [eof $f] } {
sl@0
   186
	    close $f
sl@0
   187
	    set x 1
sl@0
   188
	} else {
sl@0
   189
	    set line [read $f ]
sl@0
   190
	    set result "$result$line"
sl@0
   191
	}
sl@0
   192
    }
sl@0
   193
sl@0
   194
    set f [open "|[list $cat32] < big 2> $path(stderr)" r]
sl@0
   195
    fconfigure $f  -buffering none -blocking 0
sl@0
   196
    fileevent $f readable "readResults $f"
sl@0
   197
    set x 0
sl@0
   198
    set result ""
sl@0
   199
    vwait x
sl@0
   200
    list $result $x [contents $path(stderr)]
sl@0
   201
} "{$big} 1 stderr32"
sl@0
   202
test winpipe-4.2 {Tcl_WaitPid: return of exception codes, SIGFPE} {pcOnly exec} {
sl@0
   203
    set f [open "|[tcltest::interpreter]" w+]
sl@0
   204
    set pid [pid $f]
sl@0
   205
    puts $f "testexcept float_underflow"
sl@0
   206
    set status [catch {close $f}]
sl@0
   207
    list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2]
sl@0
   208
} {1 1 SIGFPE}
sl@0
   209
test winpipe-4.3 {Tcl_WaitPid: return of exception codes, SIGSEGV} {pcOnly exec} {
sl@0
   210
    set f [open "|[tcltest::interpreter]" w+]
sl@0
   211
    set pid [pid $f]
sl@0
   212
    puts $f "testexcept access_violation"
sl@0
   213
    set status [catch {close $f}]
sl@0
   214
    list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2]
sl@0
   215
} {1 1 SIGSEGV}
sl@0
   216
test winpipe-4.4 {Tcl_WaitPid: return of exception codes, SIGILL} {pcOnly exec} {
sl@0
   217
    set f [open "|[tcltest::interpreter]" w+]
sl@0
   218
    set pid [pid $f]
sl@0
   219
    puts $f "testexcept illegal_instruction"
sl@0
   220
    set status [catch {close $f}]
sl@0
   221
    list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2]
sl@0
   222
} {1 1 SIGILL}
sl@0
   223
test winpipe-4.5 {Tcl_WaitPid: return of exception codes, SIGINT} {pcOnly exec} {
sl@0
   224
    set f [open "|[tcltest::interpreter]" w+]
sl@0
   225
    set pid [pid $f]
sl@0
   226
    puts $f "testexcept ctrl+c"
sl@0
   227
    set status [catch {close $f}]
sl@0
   228
    list $status [expr {$pid == [lindex $::errorCode 1]}] [lindex $::errorCode 2]
sl@0
   229
} {1 1 SIGINT}
sl@0
   230
sl@0
   231
set path(nothing) [makeFile {} nothing]
sl@0
   232
close [open $path(nothing) w]
sl@0
   233
sl@0
   234
catch {set env_tmp $env(TMP)}
sl@0
   235
catch {set env_temp $env(TEMP)}
sl@0
   236
sl@0
   237
set env(TMP) c:/
sl@0
   238
set env(TEMP) c:/
sl@0
   239
sl@0
   240
test winpipe-5.1 {TclpCreateTempFile: cleanup temp files} {pcOnly exec} {
sl@0
   241
    set x {}
sl@0
   242
    set existing [glob -nocomplain c:/tcl*.tmp]
sl@0
   243
    exec [interpreter] < nothing 
sl@0
   244
    foreach p [glob -nocomplain c:/tcl*.tmp] {
sl@0
   245
	if {[lsearch $existing $p] == -1} {
sl@0
   246
	    lappend x $p
sl@0
   247
	}
sl@0
   248
    }
sl@0
   249
    set x
sl@0
   250
} {}
sl@0
   251
test winpipe-5.2 {TclpCreateTempFile: TMP and TEMP not defined} {pcOnly exec} {
sl@0
   252
    set tmp $env(TMP)
sl@0
   253
    set temp $env(TEMP)
sl@0
   254
    unset env(TMP)
sl@0
   255
    unset env(TEMP)
sl@0
   256
    exec [interpreter] < nothing
sl@0
   257
    set env(TMP) $tmp
sl@0
   258
    set env(TEMP) $temp
sl@0
   259
    set x {}
sl@0
   260
} {}
sl@0
   261
test winpipe-5.3 {TclpCreateTempFile: TMP specifies non-existent directory} \
sl@0
   262
	{pcOnly exec } {
sl@0
   263
    set tmp $env(TMP)
sl@0
   264
    set env(TMP) snarky
sl@0
   265
    exec [interpreter] < nothing
sl@0
   266
    set env(TMP) $tmp
sl@0
   267
    set x {}
sl@0
   268
} {}
sl@0
   269
test winpipe-5.4 {TclpCreateTempFile: TEMP specifies non-existent directory} \
sl@0
   270
	{pcOnly exec} {
sl@0
   271
    set tmp $env(TMP)
sl@0
   272
    set temp $env(TEMP)
sl@0
   273
    unset env(TMP)
sl@0
   274
    set env(TEMP) snarky
sl@0
   275
    exec [interpreter] < nothing
sl@0
   276
    set env(TMP) $tmp
sl@0
   277
    set env(TEMP) $temp
sl@0
   278
    set x {}
sl@0
   279
} {}
sl@0
   280
sl@0
   281
test winpipe-6.1 {PipeSetupProc & PipeCheckProc: read threads} \
sl@0
   282
	{pcOnly exec cat32} {
sl@0
   283
    set f [open "|[list $cat32]" r+]
sl@0
   284
    fconfigure $f -blocking 0
sl@0
   285
    fileevent $f writable { set x writable }
sl@0
   286
    set x {}
sl@0
   287
    vwait x
sl@0
   288
    fileevent $f writable {}
sl@0
   289
    fileevent $f readable { lappend x readable }
sl@0
   290
    after 100 { lappend x timeout }
sl@0
   291
    vwait x
sl@0
   292
    puts $f foobar
sl@0
   293
    flush $f
sl@0
   294
    vwait x
sl@0
   295
    lappend x [read $f]
sl@0
   296
    after 100 { lappend x timeout }
sl@0
   297
    vwait x
sl@0
   298
    fconfigure $f -blocking 1
sl@0
   299
    lappend x [catch {close $f} msg] $msg
sl@0
   300
} {writable timeout readable {foobar
sl@0
   301
} timeout 1 stderr32}
sl@0
   302
test winpipe-6.2 {PipeSetupProc & PipeCheckProc: write threads} \
sl@0
   303
	{pcOnly exec cat32} {
sl@0
   304
    set f [open "|[list $cat32]" r+]
sl@0
   305
    fconfigure $f -blocking 0
sl@0
   306
    fileevent $f writable { set x writable }
sl@0
   307
    set x {}
sl@0
   308
    vwait x
sl@0
   309
    puts -nonewline $f $big$big$big$big
sl@0
   310
    flush $f
sl@0
   311
    after 100 { lappend x timeout }
sl@0
   312
    vwait x
sl@0
   313
    lappend x [catch {close $f} msg] $msg
sl@0
   314
} {writable timeout 0 {}}
sl@0
   315
sl@0
   316
set path(echoArgs.tcl) [makeFile {
sl@0
   317
    puts "[list $argv0 $argv]"
sl@0
   318
} echoArgs.tcl]
sl@0
   319
sl@0
   320
### validate the raw output of BuildCommandLine().
sl@0
   321
###
sl@0
   322
test winpipe-7.1 {BuildCommandLine: null arguments} {pcOnly exec} {
sl@0
   323
    exec $env(COMSPEC) /c echo foo "" bar
sl@0
   324
} {foo "" bar}
sl@0
   325
test winpipe-7.2 {BuildCommandLine: null arguments} {pcOnly exec} {
sl@0
   326
    exec $env(COMSPEC) /c echo foo {} bar
sl@0
   327
} {foo "" bar}
sl@0
   328
test winpipe-7.3 {BuildCommandLine: dbl quote quoting #1} {pcOnly exec} {
sl@0
   329
    exec $env(COMSPEC) /c echo foo {"} bar
sl@0
   330
} {foo \" bar}
sl@0
   331
test winpipe-7.4 {BuildCommandLine: dbl quote quoting #2} {pcOnly exec} {
sl@0
   332
    exec $env(COMSPEC) /c echo foo {""} bar
sl@0
   333
} {foo \"\" bar}
sl@0
   334
test winpipe-7.5 {BuildCommandLine: dbl quote quoting #3} {pcOnly exec} {
sl@0
   335
    exec $env(COMSPEC) /c echo foo {" } bar
sl@0
   336
} {foo "\" " bar}
sl@0
   337
test winpipe-7.6 {BuildCommandLine: dbl quote quoting #4} {pcOnly exec} {
sl@0
   338
    exec $env(COMSPEC) /c echo foo {a="b"} bar
sl@0
   339
} {foo a=\"b\" bar}
sl@0
   340
test winpipe-7.7 {BuildCommandLine: dbl quote quoting #5} {pcOnly exec} {
sl@0
   341
    exec $env(COMSPEC) /c echo foo {a = "b"} bar
sl@0
   342
} {foo "a = \"b\"" bar}
sl@0
   343
test winpipe-7.8 {BuildCommandLine: dbl quote quoting #6} {pcOnly exec} {
sl@0
   344
    exec $env(COMSPEC) /c echo {"hello"} {""hello""} {"""hello"""} {"\"hello\""} {he llo} {he " llo}
sl@0
   345
} {\"hello\" \"\"hello\"\" \"\"\"hello\"\"\" \"\\\"hello\\\"\" "he llo" "he \" llo"}
sl@0
   346
test winpipe-7.9 {BuildCommandLine: N backslashes followed a quote rule #1} {pcOnly exec} {
sl@0
   347
    exec $env(COMSPEC) /c echo foo \\ bar
sl@0
   348
} {foo \ bar}
sl@0
   349
test winpipe-7.10 {BuildCommandLine: N backslashes followed a quote rule #2} {pcOnly exec} {
sl@0
   350
    exec $env(COMSPEC) /c echo foo \\\\ bar
sl@0
   351
} {foo \\ bar}
sl@0
   352
test winpipe-7.11 {BuildCommandLine: N backslashes followed a quote rule #3} {pcOnly exec} {
sl@0
   353
    exec $env(COMSPEC) /c echo foo \\\ \\ bar
sl@0
   354
} {foo "\ \\" bar}
sl@0
   355
test winpipe-7.12 {BuildCommandLine: N backslashes followed a quote rule #4} {pcOnly exec} {
sl@0
   356
    exec $env(COMSPEC) /c echo foo \\\ \\\\ bar
sl@0
   357
} {foo "\ \\\\" bar}
sl@0
   358
test winpipe-7.13 {BuildCommandLine: N backslashes followed a quote rule #5} {pcOnly exec} {
sl@0
   359
    exec $env(COMSPEC) /c echo foo \\\ \\\\\\ bar
sl@0
   360
} {foo "\ \\\\\\" bar}
sl@0
   361
test winpipe-7.14 {BuildCommandLine: N backslashes followed a quote rule #6} {pcOnly exec} {
sl@0
   362
    exec $env(COMSPEC) /c echo foo \\\ \\\" bar
sl@0
   363
} {foo "\ \\\"" bar}
sl@0
   364
test winpipe-7.15 {BuildCommandLine: N backslashes followed a quote rule #7} {pcOnly exec} {
sl@0
   365
    exec $env(COMSPEC) /c echo foo \\\ \\\\\" bar
sl@0
   366
} {foo "\ \\\\\"" bar}
sl@0
   367
test winpipe-7.16 {BuildCommandLine: N backslashes followed a quote rule #8} {pcOnly exec} {
sl@0
   368
    exec $env(COMSPEC) /c echo foo \\\ \\\\\\\" bar
sl@0
   369
} {foo "\ \\\\\\\"" bar}
sl@0
   370
test winpipe-7.17 {BuildCommandLine: special chars #4} {pcOnly exec} {
sl@0
   371
    exec $env(COMSPEC) /c echo foo \{ bar
sl@0
   372
} "foo \{ bar"
sl@0
   373
test winpipe-7.18 {BuildCommandLine: special chars #5} {pcOnly exec} {
sl@0
   374
    exec $env(COMSPEC) /c echo foo \} bar
sl@0
   375
} "foo \} bar"
sl@0
   376
sl@0
   377
### validate the pass-thru from BuildCommandLine() to the crt's parse_cmdline().
sl@0
   378
###
sl@0
   379
test winpipe-8.1 {BuildCommandLine/parse_cmdline pass-thru: null arguments} {pcOnly exec} {
sl@0
   380
    exec [interpreter] $path(echoArgs.tcl) foo "" bar
sl@0
   381
} [list $path(echoArgs.tcl) [list foo {} bar]]
sl@0
   382
test winpipe-8.2 {BuildCommandLine/parse_cmdline pass-thru: null arguments} {pcOnly exec} {
sl@0
   383
    exec [interpreter] $path(echoArgs.tcl) foo {} bar
sl@0
   384
} [list $path(echoArgs.tcl) [list foo {} bar]]
sl@0
   385
test winpipe-8.3 {BuildCommandLine/parse_cmdline pass-thru: dbl quote quoting #1} {pcOnly exec} {
sl@0
   386
    exec [interpreter] $path(echoArgs.tcl) foo {"} bar
sl@0
   387
} [list $path(echoArgs.tcl) [list foo {"} bar]]
sl@0
   388
test winpipe-8.4 {BuildCommandLine/parse_cmdline pass-thru: dbl quote quoting #2} {pcOnly exec} {
sl@0
   389
    exec [interpreter] $path(echoArgs.tcl) foo {""} bar
sl@0
   390
} [list $path(echoArgs.tcl) [list foo {""} bar]]
sl@0
   391
test winpipe-8.5 {BuildCommandLine/parse_cmdline pass-thru: dbl quote quoting #3} {pcOnly exec} {
sl@0
   392
    exec [interpreter] $path(echoArgs.tcl) foo {" } bar
sl@0
   393
} [list $path(echoArgs.tcl) [list foo {" } bar]]
sl@0
   394
test winpipe-8.6 {BuildCommandLine/parse_cmdline pass-thru: dbl quote quoting #4} {pcOnly exec} {
sl@0
   395
    exec [interpreter] $path(echoArgs.tcl) foo {a="b"} bar
sl@0
   396
} [list $path(echoArgs.tcl) [list foo {a="b"} bar]]
sl@0
   397
test winpipe-8.7 {BuildCommandLine/parse_cmdline pass-thru: dbl quote quoting #5} {pcOnly exec} {
sl@0
   398
    exec [interpreter] $path(echoArgs.tcl) foo {a = "b"} bar
sl@0
   399
} [list $path(echoArgs.tcl) [list foo {a = "b"} bar]]
sl@0
   400
test winpipe-8.8 {BuildCommandLine/parse_cmdline pass-thru: dbl quote quoting #6} {pcOnly exec} {
sl@0
   401
    exec [interpreter] $path(echoArgs.tcl) {"hello"} {""hello""} {"""hello"""} {"\"hello\""} {he llo} {he " llo}
sl@0
   402
} [list $path(echoArgs.tcl) [list {"hello"} {""hello""} {"""hello"""} {"\"hello\""} {he llo} {he " llo}]]
sl@0
   403
test winpipe-8.9 {BuildCommandLine/parse_cmdline pass-thru: N backslashes followed a quote rule #1} {pcOnly exec} {
sl@0
   404
    exec [interpreter] $path(echoArgs.tcl) foo \\ bar
sl@0
   405
} [list $path(echoArgs.tcl) [list foo \\ bar]]
sl@0
   406
test winpipe-8.10 {BuildCommandLine/parse_cmdline pass-thru: N backslashes followed a quote rule #2} {pcOnly exec} {
sl@0
   407
    exec [interpreter] $path(echoArgs.tcl) foo \\\\ bar
sl@0
   408
} [list $path(echoArgs.tcl) [list foo \\\\ bar]]
sl@0
   409
test winpipe-8.11 {BuildCommandLine/parse_cmdline pass-thru: N backslashes followed a quote rule #3} {pcOnly exec} {
sl@0
   410
    exec [interpreter] $path(echoArgs.tcl) foo \\\ \\ bar
sl@0
   411
} [list $path(echoArgs.tcl) [list foo \\\ \\ bar]]
sl@0
   412
test winpipe-8.12 {BuildCommandLine/parse_cmdline pass-thru: N backslashes followed a quote rule #4} {pcOnly exec} {
sl@0
   413
    exec [interpreter] $path(echoArgs.tcl) foo \\\ \\\\ bar
sl@0
   414
} [list $path(echoArgs.tcl) [list foo \\\ \\\\ bar]]
sl@0
   415
test winpipe-8.13 {BuildCommandLine/parse_cmdline pass-thru: N backslashes followed a quote rule #5} {pcOnly exec} {
sl@0
   416
    exec [interpreter] $path(echoArgs.tcl) foo \\\ \\\\\\ bar
sl@0
   417
} [list $path(echoArgs.tcl) [list foo \\\ \\\\\\ bar]]
sl@0
   418
test winpipe-8.14 {BuildCommandLine/parse_cmdline pass-thru: N backslashes followed a quote rule #6} {pcOnly exec} {
sl@0
   419
    exec [interpreter] $path(echoArgs.tcl) foo \\\ \\\" bar
sl@0
   420
} [list $path(echoArgs.tcl) [list foo \\\ \\\" bar]]
sl@0
   421
test winpipe-8.15 {BuildCommandLine/parse_cmdline pass-thru: N backslashes followed a quote rule #7} {pcOnly exec} {
sl@0
   422
    exec [interpreter] $path(echoArgs.tcl) foo \\\ \\\\\" bar
sl@0
   423
} [list $path(echoArgs.tcl) [list foo \\\ \\\\\" bar]]
sl@0
   424
test winpipe-8.16 {BuildCommandLine/parse_cmdline pass-thru: N backslashes followed a quote rule #8} {pcOnly exec} {
sl@0
   425
    exec [interpreter] $path(echoArgs.tcl) foo \\\ \\\\\\\" bar
sl@0
   426
} [list $path(echoArgs.tcl) [list foo \\\ \\\\\\\" bar]]
sl@0
   427
test winpipe-8.17 {BuildCommandLine/parse_cmdline pass-thru: special chars #1} {pcOnly exec} {
sl@0
   428
    exec [interpreter] $path(echoArgs.tcl) foo \{ bar
sl@0
   429
} [list $path(echoArgs.tcl) [list foo \{ bar]]
sl@0
   430
test winpipe-8.18 {BuildCommandLine/parse_cmdline pass-thru: special chars #2} {pcOnly exec} {
sl@0
   431
    exec [interpreter] $path(echoArgs.tcl) foo \} bar
sl@0
   432
} [list $path(echoArgs.tcl) [list foo \} bar]]
sl@0
   433
test winpipe-8.19 {ensure parse_cmdline isn't doing wildcard replacement} {pcOnly exec} {
sl@0
   434
    exec [interpreter] $path(echoArgs.tcl) foo * makefile.?c bar
sl@0
   435
} [list $path(echoArgs.tcl) [list foo * makefile.?c bar]]
sl@0
   436
sl@0
   437
# restore old values for env(TMP) and env(TEMP)
sl@0
   438
sl@0
   439
if {[catch {set env(TMP) $env_tmp}]} {
sl@0
   440
    unset env(TMP)
sl@0
   441
}
sl@0
   442
if {[catch {set env(TEMP) $env_temp}]} {
sl@0
   443
    unset env(TEMP)
sl@0
   444
}
sl@0
   445
sl@0
   446
# cleanup
sl@0
   447
file delete big little stdout stderr nothing echoArgs.tcl
sl@0
   448
::tcltest::cleanupTests
sl@0
   449
return