working hostname call
[scpubgit/TenDotTcl.git] / t / connection.t
1 BEGIN { exec(tclsh => 't/tcl/harness.tcl' => $0) }
2
3 package require ten
4 package require json::write
5
6 set connector [ten::connector::perl %AUTO%]
7
8 set conn [$connector connect]
9
10 set f1 [
11   $conn send call [ json::write string class_call_handler ] \
12     0 [ json::write string call ] \
13     [ json::write string Sys::Hostname ] [ json::write string hostname ]
14 ]
15
16 set ready_args ""
17
18 $f1 on_ready [list apply {{name future} {set $name [$future get]}} "[namespace current]::ready_args" ]
19
20 $f1 await_ready
21
22 is $ready_args [exec hostname] "hostname returned ok"