diff options
Diffstat (limited to 'tests/pid.test')
-rw-r--r-- | tests/pid.test | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/pid.test b/tests/pid.test index 56ffcf8..a1773fe 100644 --- a/tests/pid.test +++ b/tests/pid.test @@ -17,19 +17,18 @@ source [file dirname [info script]]/testing.tcl needs cmd pid posix needs cmd exec -catch {package require regexp} -testConstraint regexp [expr {[info commands regexp] ne {}}] -testConstraint pipe [expr {[info commands pipe] ne {}}] -testConstraint getpid [expr {[catch pid] == 0}] +constraint cmd regexp +constraint cmd pipe +constraint cmd pid # This is a proxy for tcl || tclcompat -testConstraint pidchan [expr {[info commands fconfigure] ne {}}] +constraint cmd fconfigure file delete test1 -test pid-1.1 {pid command} {regexp getpid} { +test pid-1.1 {pid command} {regexp pid} { regexp {(^[0-9]+$)|(^0x[0-9a-fA-F]+$)} [pid] } 1 -test pid-1.2 {pid command} {regexp pipe pidchan} { +test pid-1.2 {pid command} {regexp pipe fconfigure} { set f [open {| echo foo | cat >test1} w] set pids [pid $f] close $f @@ -38,16 +37,16 @@ test pid-1.2 {pid command} {regexp pipe pidchan} { [regexp {^[0-9]+$} [lindex $pids 1]] \ [expr {[lindex $pids 0] == [lindex $pids 1]}] } {2 1 1 0} -test pid-1.3 {pid command} {pipe pidchan} { +test pid-1.3 {pid command} {pipe fconfigure} { set f [open test1 w] set pids [pid $f] close $f set pids } {} -test pid-1.4 {pid command} pidchan { +test pid-1.4 {pid command} fconfigure { list [catch {pid a b} msg] $msg } {1 {wrong # args: should be "pid ?channelId?"}} -test pid-1.5 {pid command} pidchan { +test pid-1.5 {pid command} fconfigure { list [catch {pid gorp} msg] $msg } {1 {can not find channel named "gorp"}} |