Artifact befaf80706a16f52f2f4a552e2764601dcaa415d:
- File test/th1-tcl1.txt — part of check-in [53b9445b2c] at 2011-08-28 23:45:18 on branch tcl-integration — Use macros to tidy up TH1 to Tcl argument marshalling. Use the Tcl interp result when Tcl_ExprObj does not return ok. Check for Tcl interp deletion. The TH1 'puts' command should flush when writing to stdout. Add 'repository' TH1 command. Use obj API to get Tcl cmdInfo. Add tests for Tcl integration. (user: mistachkin size: 870) [more...]
<th1> # # This is a "TH1 fragment" used to test the Tcl integration features of TH1. # The corresponding test file executes this file using the test-th-render # Fossil command. # set channel stdout; tclInvoke set channel $channel proc doOut {msg} {puts $msg; puts \n} doOut [tclEval clock seconds] doOut [tclEval {set x [clock seconds]}] tclEval {puts $channel "[clock seconds]"} tclInvoke puts $channel "via Tcl invoke" doOut [tclExpr 2+2] doOut [tclExpr 2 + 2] doOut [tclInvoke set x "two words"] doOut [tclInvoke eval set y one_word] doOut [tclInvoke eval {set z "three words now"}] doOut [set x [tclEval {set x [clock seconds]}]] doOut [tclInvoke th1Eval {set y "two words"}] doOut [set z [tclInvoke th1Expr {2+2}]] doOut $x doOut $y doOut $z doOut [tclEval set x] doOut [tclEval set y] doOut [tclEval set z] </th1>