1# vim: ft=tcl ts=4 sw=4 expandtab:
2
3tcltest::loadTestedCommands
4
5tcltest::test callback-1.1 {use callback to retrieve result} -constraints {
6    serverIsRunning
7} -setup {
8    set r [retcl new]
9} -body {
10    proc mycb {resVar args} {
11        upvar $resVar res
12        set res $args
13    }
14    set res {}
15    $r SET a 42
16    $r -cb [list mycb [namespace current]::res] GET a
17    vwait res
18    set res
19} -cleanup {
20    $r destroy
21} -result {rds:2 BulkString 42}
22