X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fconnection.t;h=e0425c97854ac8023da13c0fc493da6ed6f8bba3;hb=47f04c562fa3f1001830a48ec4a9e15717d71976;hp=92b9317db55b5a896c9f72ab86f62a38e29da291;hpb=9540dca14bd5b1d4edd1889ead07c2fa4d92af6c;p=scpubgit%2FTenDotTcl.git diff --git a/t/connection.t b/t/connection.t index 92b9317..e0425c9 100644 --- a/t/connection.t +++ b/t/connection.t @@ -7,24 +7,26 @@ set connector [ten::connector::perl %AUTO%] set conn [$connector connect] +proc jws {args} { + set ret {} + foreach str $args { + lappend ret [ json::write string $str ] + } + return $ret +} + 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 ] + $conn send call {*}[jws class_call_handler 0 call Sys::Hostname hostname] ] set ready_args "" $f1 on_ready [list apply {{name future} {set $name [$future get]}} "[namespace current]::ready_args" ] -$f1 retain - -$f1 await_ready - set my_host [exec hostname] -is [$f1 get] $my_host "hostname retuend ok via get" - -$f1 free +is [$f1 await_get] $my_host "hostname returned ok via get" is $ready_args $my_host "hostname returned ok via on_ready" + +done_testing