--- /dev/null
+BEGIN { exec(tclsh => 't/tcl/harness.tcl' => $0) }
+
+package require ten
+
+set tfh [open {|./echo.pl} r+]
+
+fconfigure $tfh -buffering line
+
+set rch [ten::read_channel %AUTO% -fh $tfh]
+
+proc line_cb {line} {
+ global got_line
+ set got_line $line
+}
+
+puts $tfh foo
+
+$rch configure -on_line_call line_cb
+
+global got_line
+
+vwait got_line
+
+is $got_line foo "Got line from read channel (send before set cb)"
+
+puts $tfh bar
+
+vwait got_line
+
+is $got_line bar "Got line from read channel (send after set cb)"
+
+done_testing
+