mercredi 14 septembre 2016

tcltest pass variable from -setup script to -body script

I am using tcltest to write some simple unit tests for my TCL procs.
I'm wondering if there is a way to make a variable from the -setup script visible inside the -body script? Maybe using upvar/uplevel somehow?
So far I have tried the naive approach which does produce an error ("Test file error: can't read "N": no such variable"):

tcltest::test equal4_test {
} - setup {
    set N 4
} -body {
    equal4 $N
} -result 1

Aucun commentaire:

Enregistrer un commentaire