From: Matt S Trout Date: Sun, 9 Sep 2012 15:38:00 +0000 (+0000) Subject: add jws proc to simplify connection.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FTenDotTcl.git;a=commitdiff_plain;h=61761da290253891bc6e4d46d8b619b5e39ea038 add jws proc to simplify connection.t --- diff --git a/t/connection.t b/t/connection.t index 92b9317..41e0e2c 100644 --- a/t/connection.t +++ b/t/connection.t @@ -7,10 +7,16 @@ 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 "" @@ -28,3 +34,5 @@ is [$f1 get] $my_host "hostname retuend ok via get" $f1 free is $ready_args $my_host "hostname returned ok via on_ready" + +done_testing