add commented out waits forever test - read callback not called on close
[scpubgit/TenDotTcl.git] / t / readch.t
CommitLineData
3c6a0ce7 1BEGIN { exec(tclsh => 't/tcl/harness.tcl' => $0) }
2
3package require ten
4
5set tfh [open {|./echo.pl} r+]
6
7fconfigure $tfh -buffering line
8
9set rch [ten::read_channel %AUTO% -fh $tfh]
10
11proc line_cb {line} {
12 global got_line
13 set got_line $line
14}
15
16puts $tfh foo
17
18$rch configure -on_line_call line_cb
19
20global got_line
21
22vwait got_line
23
24is $got_line foo "Got line from read channel (send before set cb)"
25
26puts $tfh bar
27
28vwait got_line
29
30is $got_line bar "Got line from read channel (send after set cb)"
31
4bac2150 32#$rch configure -on_close_call {global got_line; set got_line bye}
33
34#vwait got_line
3c6a0ce7 35
4bac2150 36#is $got_line bye "Close handler called"
37
38done_testing