X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fconnection.t;fp=t%2Fconnection.t;h=6ce79311fa424e6e117126cb756839f17c18d479;hb=0e93bc12741bd93c6e35d81da4a44b32f7a8cdf9;hp=0000000000000000000000000000000000000000;hpb=458402ad7848042949e49d5b73831f75a870317c;p=scpubgit%2FTenDotTcl.git diff --git a/t/connection.t b/t/connection.t new file mode 100644 index 0000000..6ce7931 --- /dev/null +++ b/t/connection.t @@ -0,0 +1,22 @@ +BEGIN { exec(tclsh => 't/tcl/harness.tcl' => $0) } + +package require ten +package require json::write + +set connector [ten::connector::perl %AUTO%] + +set conn [$connector connect] + +set f1 [ + $conn send call [ json::write string class_call_handler ] \ + 0 [ json::write string call ] \ + [ json::write string Sys::Hostname ] [ json::write string hostname ] +] + +set ready_args "" + +$f1 on_ready [list apply {{name future} {set $name [$future get]}} "[namespace current]::ready_args" ] + +$f1 await_ready + +is $ready_args [exec hostname] "hostname returned ok"