Diff
Not logged in

Differences From Artifact [9d8b8d0249]:

To Artifact [d88191c453]:


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

catch {
    ::tcltest::loadTestedCommands
    package require -exact Tcltest [info patchlevel]
    set ::tcltestlib [lindex [package ifneeded Tcltest [info patchlevel]] 1]
}


testConstraint testfilehandler [llength [info commands testfilehandler]]
testConstraint testexithandler [llength [info commands testexithandler]]
testConstraint testfilewait [llength [info commands testfilewait]]
testConstraint exec [llength [info commands exec]]

test event-1.1 {Tcl_CreateFileHandler, reading} -setup {
    testfilehandler close







<







14
15
16
17
18
19
20

21
22
23
24
25
26
27

catch {
    ::tcltest::loadTestedCommands
    package require -exact Tcltest [info patchlevel]
    set ::tcltestlib [lindex [package ifneeded Tcltest [info patchlevel]] 1]
}


testConstraint testfilehandler [llength [info commands testfilehandler]]
testConstraint testexithandler [llength [info commands testexithandler]]
testConstraint testfilewait [llength [info commands testfilewait]]
testConstraint exec [llength [info commands exec]]

test event-1.1 {Tcl_CreateFileHandler, reading} -setup {
    testfilehandler close
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
test event-11.1 {Tcl_VwaitCmd procedure} -returnCodes error -body {
    vwait
} -result {wrong # args: should be "vwait name"}
test event-11.2 {Tcl_VwaitCmd procedure} -returnCodes error -body {
    vwait a b
} -result {wrong # args: should be "vwait name"}
test event-11.3 {Tcl_VwaitCmd procedure} -setup {
    catch {unset x}
} -body {
    set x 1
    vwait x(1)
} -returnCodes error -result {can't trace "x(1)": variable isn't array}
test event-11.4 {Tcl_VwaitCmd procedure} -setup {
    foreach i [after info] {
	after cancel $i







|







509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
test event-11.1 {Tcl_VwaitCmd procedure} -returnCodes error -body {
    vwait
} -result {wrong # args: should be "vwait name"}
test event-11.2 {Tcl_VwaitCmd procedure} -returnCodes error -body {
    vwait a b
} -result {wrong # args: should be "vwait name"}
test event-11.3 {Tcl_VwaitCmd procedure} -setup {
    unset -nocomplain x
} -body {
    set x 1
    vwait x(1)
} -returnCodes error -result {can't trace "x(1)": variable isn't array}
test event-11.4 {Tcl_VwaitCmd procedure} -setup {
    foreach i [after info] {
	after cancel $i
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
    set f1 [open $test1file w]
    proc accept {s args} {
	puts $s foobar
	close $s
    }
    set s1 [socket -server accept -myaddr 127.0.0.1 0]
    after 1000
    set s2 [socket 127.0.0.1 [lindex [fconfigure $s1 -sockname] 2]]
    close $s1
    set x 0
    set y 0
    set z 0
    fileevent $s2 readable {incr z}
    vwait z
    fileevent $f1 writable {incr x; if {$y == 3} {set z done}}







|







544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
    set f1 [open $test1file w]
    proc accept {s args} {
	puts $s foobar
	close $s
    }
    set s1 [socket -server accept -myaddr 127.0.0.1 0]
    after 1000
    set s2 [socket 127.0.0.1 [lindex [chan configure $s1 -sockname] 2]]
    close $s1
    set x 0
    set y 0
    set z 0
    fileevent $s2 readable {incr z}
    vwait z
    fileevent $f1 writable {incr x; if {$y == 3} {set z done}}