Index: tests/info-variable.test =================================================================== diff -u -N -r8be635fcabc150f3922951c71d9919d62db09b10 -r0f683270c600d1bbf44a52cb80ee49744c6c1034 --- tests/info-variable.test (.../info-variable.test) (revision 8be635fcabc150f3922951c71d9919d62db09b10) +++ tests/info-variable.test (.../info-variable.test) (revision 0f683270c600d1bbf44a52cb80ee49744c6c1034) @@ -208,22 +208,30 @@ } nx::test case switch-params { + + set ::p1 "p1:boolean" + set ::p2 "p2:switch" + set cls [nx::Class new { - :property p1:boolean - :property p2:switch + :property $::p1 + :property $::p2 }] ? [list lmap p [$cls info variables] "[list $cls info variable parameter] \$p"] \ - "p1:boolean p2:switch" + [list $::p1 $::p2] ? [list lmap p [$cls info variables] "[list $cls info variable definition] \$p"] \ - [list [list $cls property -accessor none p1:boolean] \ - [list $cls property -accessor none p2:switch]] -} + [list [list $cls property -accessor none $::p1] \ + [list $cls property -accessor none $::p2]] -# TODO: switch on method parameters + info? -# TODO: switch as sugar for boolean,noarg for nonpos? + set obj [$cls new] + set ::lookupParams [$obj info lookup parameters configure] + ? {expr {"-$::p1" in $::lookupParams}} 1 + ? {expr {"-$::p2" in $::lookupParams}} 1 + ? [list string match "?-p1 /boolean/? ?-p2? *" [$obj info lookup syntax configure]] 1 +} + nx::test case object-variables { nx::Class create Bar { :property {p 9}