Index: TODO =================================================================== diff -u -r2d4492a6bceacd7df7ef0a305ca78b42128da5ca -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- TODO (.../TODO) (revision 2d4492a6bceacd7df7ef0a305ca78b42128da5ca) +++ TODO (.../TODO) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -4665,14 +4665,22 @@ nsf.c: - Eliminate all use of Tcl_GetStringFromObj() function. +nx::test: +- use the standard configure interface for + configuring instead of own version +- changed from nx::Test to nx::test + (user never has to know that nx::Test is a class). +- change test cases to newer interface +- don't use "namespace import nx::*" in test cases + when not required + + + ======================================================================== TODO: - introspection (e.g. "syntax" for unregistered cmds/methods) - spellcheck / ChangeLog (to point out differences to 2.0b3) -- maybe change nx::Test to nx::test - (user never has to know that nx::Test is a class). - Stefan: API-related items * - naming in slots: "incremental", "reconfigure" Index: doc/example-scripts/bagel.tcl =================================================================== diff -u -r2872e1f0a6523c7fb44952492e05414c4f8d9c84 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- doc/example-scripts/bagel.tcl (.../bagel.tcl) (revision 2872e1f0a6523c7fb44952492e05414c4f8d9c84) +++ doc/example-scripts/bagel.tcl (.../bagel.tcl) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -7,7 +7,7 @@ package req nx package req nx::test -nx::Test parameter count 1 +nx::test configure -count 1 # Suppose we need to work with many bagels in our application. We # might start by creating a Bagel class. Index: doc/example-scripts/container.tcl =================================================================== diff -u -re0419345b49587b5738f87c6d828dfc5ae4b3276 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- doc/example-scripts/container.tcl (.../container.tcl) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) +++ doc/example-scripts/container.tcl (.../container.tcl) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -6,7 +6,7 @@ package req nx package req nx::test -nx::Test parameter count 1 +nx::test configure -count 1 # == Simple Container # Index: doc/example-scripts/ruby-mixins.tcl =================================================================== diff -u -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- doc/example-scripts/ruby-mixins.tcl (.../ruby-mixins.tcl) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ doc/example-scripts/ruby-mixins.tcl (.../ruby-mixins.tcl) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -7,7 +7,7 @@ # in the same script. package req nx::test -nx::Test parameter count 1 +nx::test configure -count 1 # # One important difference between mixin classes in NX and Ruby's Index: library/xotcl/tests/slottest.xotcl =================================================================== diff -u -r4c6c39cd6a1aa703a9a8cf7dc89baf7d4a58d6c5 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- library/xotcl/tests/slottest.xotcl (.../slottest.xotcl) (revision 4c6c39cd6a1aa703a9a8cf7dc89baf7d4a58d6c5) +++ library/xotcl/tests/slottest.xotcl (.../slottest.xotcl) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -3,7 +3,7 @@ package require XOTcl 2.0; namespace import -force ::xotcl::* package require nx::test -nx::Test parameter count 1000 +nx::test configure -count 1000 # what's new: # - slots instances are manager objects for slot values @@ -146,7 +146,7 @@ # ::xotcl::MetaSlot create Role -superclass Attribute -parameter {references} -::nx::Test case info-slots-heritage { +::nx::test case info-slots-heritage { ::xotcl::Class create C -parameter {c1 c2} ::xotcl::Class create D -superclass C -parameter {c2 c3} @@ -372,7 +372,7 @@ #puts [A serialize] ################### -nx::Test case req-param { +nx::test case req-param { ::xotcl::Class create C -parameter {y:required x:required} C instproc init args {set ::_ $args} @@ -389,7 +389,7 @@ ################### # Application Slots # -nx::Test case app-slots +nx::test case app-slots Class Person -slots { Attribute create name @@ -475,7 +475,7 @@ ####################################################### # defaultcmd via slots ####################################################### -nx::Test case defaultcmd +nx::test case defaultcmd set ::hu 0 Class C -slots { Attribute create x -defaultcmd {incr ::hu; set x 101} @@ -489,7 +489,7 @@ ####################################################### # nested contains ####################################################### -nx::Test case nested-contains +nx::test case nested-contains Class Point -parameter {{x 100} {y 300}} Class Rectangle -parameter {color} @@ -521,7 +521,7 @@ ####################################################### # assign via slots ####################################################### -nx::Test case assign-via-slots +nx::test case assign-via-slots Class create A -slots { Attribute create foo -default 1 -proc assign {domain var value} { @@ -568,7 +568,7 @@ x move y ? {y a} 4 -::nx::Test case slots-compat +::nx::test case slots-compat # # Some tests covering the backward compatibility of NX/XOTcl2 hybrid # slots to the XOTcl1 slot API (as extracted from the XOTcl language Index: library/xotcl/tests/speedtest.xotcl =================================================================== diff -u -rd679ea5694ec3aad76b06767bb23287965304db9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- library/xotcl/tests/speedtest.xotcl (.../speedtest.xotcl) (revision d679ea5694ec3aad76b06767bb23287965304db9) +++ library/xotcl/tests/speedtest.xotcl (.../speedtest.xotcl) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -2,26 +2,26 @@ #memory trace on package prefer latest package require XOTcl 2.0; namespace import ::xotcl::* -package require nx::test; namespace import nx::Test +package require nx::test -Test new -msg {test multiple dashed args o0} \ +nx::test new -msg {test multiple dashed args o0} \ -cmd {Object create o0 [list -set a -a1] [list -set b "-b 1 -y 2"]} \ -expected ::o0 \ -post {o0 destroy} -Test new -msg {test multiple dashed args o1} \ +nx::test new -msg {test multiple dashed args o1} \ -cmd {Object create o1 -proc foo args {return 1} [list -set a -a1] [list -set b "-b 1 -y 2"]} \ -expected ::o1 \ -post {o1} -Test new -msg {test multiple dashed args o2} \ +nx::test new -msg {test multiple dashed args o2} \ -cmd {Object create o2 {-proc foo args {return 1}} {-set -a -t1} {-set b "-b 1 -y 2"}} \ -expected ::o2 \ -post {o2 destroy} -Test new -msg {test multiple dashed args o3} \ +nx::test new -msg {test multiple dashed args o3} \ -cmd {Object create o3 -proc foo args {return 1} {-set -a -t1} {-set b "-b 1 -y 2"}} \ -expected ::o3 \ -post {o3 destroy} -Test parameter count 1000 +nx::test configure -count 1000 @ @File {description { Regression and speed test for various ways to achieve a similar @@ -201,368 +201,368 @@ D instproc init args {} D d -#Test new -cmd {llength [c info children]} -count 1 -expected 999 -#Test new -cmd {set x [llength [c info children]]} -count 1 -expected 999 -Test new -cmd {llength [c info children]} -count 1 -expected $ccount -Test new -cmd {set x [llength [c info children]]} -count 1 -expected $ccount +#nx::test new -cmd {llength [c info children]} -count 1 -expected 999 +#nx::test new -cmd {set x [llength [c info children]]} -count 1 -expected 999 +nx::test new -cmd {llength [c info children]} -count 1 -expected $ccount +nx::test new -cmd {set x [llength [c info children]]} -count 1 -expected $ccount -Test new -cmd {set x [llength [Object info instances]]} -count 1 -expected $ocount -Test new -cmd {llength [Object info instances]} -count 1 -expected $ocount +nx::test new -cmd {set x [llength [Object info instances]]} -count 1 -expected $ocount +nx::test new -cmd {llength [Object info instances]} -count 1 -expected $ocount -Test new -cmd {d istype D} -expected 1 +nx::test new -cmd {d istype D} -expected 1 -Test new -cmd {c setViaInstvar 100} -expected 100 -Test new -cmd {c setViaSetMethod 100} -expected 100 -Test new -cmd {c setViaParameter 100} -expected 100 +nx::test new -cmd {c setViaInstvar 100} -expected 100 +nx::test new -cmd {c setViaSetMethod 100} -expected 100 +nx::test new -cmd {c setViaParameter 100} -expected 100 -Test new -cmd {c existsViaInstvar} -Test new -cmd {c existsViaMyInstvar} -Test new -cmd {c existsViaExistsMethod} -Test new -cmd {c existsViaMyExistsMethod} -Test new -cmd {c existsViaDotExistsMethod} -Test new -cmd {c existsViaResolver} -Test new -cmd {c exists v} -Test new -cmd {c notExistsViaInstvar} -expected 0 -Test new -cmd {c notExistsViaExistsMethod} -expected 0 -Test new -cmd {c exists xxx} -expected 0 +nx::test new -cmd {c existsViaInstvar} +nx::test new -cmd {c existsViaMyInstvar} +nx::test new -cmd {c existsViaExistsMethod} +nx::test new -cmd {c existsViaMyExistsMethod} +nx::test new -cmd {c existsViaDotExistsMethod} +nx::test new -cmd {c existsViaResolver} +nx::test new -cmd {c exists v} +nx::test new -cmd {c notExistsViaInstvar} -expected 0 +nx::test new -cmd {c notExistsViaExistsMethod} -expected 0 +nx::test new -cmd {c exists xxx} -expected 0 -Test new -cmd {c existsAndReturnValue1} -expected 100 -Test new -cmd {c existsAndReturnValue3} -expected 100 +nx::test new -cmd {c existsAndReturnValue1} -expected 100 +nx::test new -cmd {c existsAndReturnValue3} -expected 100 -Test new -cmd {c testAndSetViaInstvar 100} -expected 100 -Test new -cmd {c testAndSetViaSetMethod 100} -expected 100 +nx::test new -cmd {c testAndSetViaInstvar 100} -expected 100 +nx::test new -cmd {c testAndSetViaSetMethod 100} -expected 100 -Test new -cmd {c readViaInstvar} -expected 99 -Test new -cmd {c readViaSetMethod} -expected 99 -Test new -cmd {c readViaParameter} -expected 99 -Test new -cmd {c readViaSetMethodNoSelf} -expected 99 +nx::test new -cmd {c readViaInstvar} -expected 99 +nx::test new -cmd {c readViaSetMethod} -expected 99 +nx::test new -cmd {c readViaParameter} -expected 99 +nx::test new -cmd {c readViaSetMethodNoSelf} -expected 99 -Test new -cmd {c readTwiceViaInstvar} -expected 99 -Test new -cmd {c readTwiceViaSetMethod} -expected 99 -Test new -cmd {c readTwiceViaParameter} -expected 99 -Test new -cmd {c readTwiceViaSetMethodNoSelf} -expected 99 +nx::test new -cmd {c readTwiceViaInstvar} -expected 99 +nx::test new -cmd {c readTwiceViaSetMethod} -expected 99 +nx::test new -cmd {c readTwiceViaParameter} -expected 99 +nx::test new -cmd {c readTwiceViaSetMethodNoSelf} -expected 99 -Test new -cmd {c readTwovarsViaInstvar} -expected 98 -Test new -cmd {c readTwovarsViaSetMethod} -expected 98 -Test new -cmd {c readTwovarsViaParameter} -expected 98 -Test new -cmd {c readTwovarsViaSetMethodNoSelf} -expected 98 +nx::test new -cmd {c readTwovarsViaInstvar} -expected 98 +nx::test new -cmd {c readTwovarsViaSetMethod} -expected 98 +nx::test new -cmd {c readTwovarsViaParameter} -expected 98 +nx::test new -cmd {c readTwovarsViaSetMethodNoSelf} -expected 98 -Test new -cmd {c instvarAlias} +nx::test new -cmd {c instvarAlias} -Test new -cmd {c incr v} -post {c set v 1} -expected 101 -Test new -cmd {c unset v; set r [c exists v]; c set v 1; set r} -expected 0 +nx::test new -cmd {c incr v} -post {c set v 1} -expected 101 +nx::test new -cmd {c unset v; set r [c exists v]; c set v 1; set r} -expected 0 -Test new -cmd {llength [Object info instances]} -count 1 -expected $ocount -Test new -cmd {set x [llength [Object info instances]]} -count 1 -expected $ocount +nx::test new -cmd {llength [Object info instances]} -count 1 -expected $ocount +nx::test new -cmd {set x [llength [Object info instances]]} -count 1 -expected $ocount -Test new -cmd {c explicitReturn} -Test new -cmd {c implicitReturn} -Test new -cmd {c explicitReturnFromVar} -Test new -cmd {c implicitReturnFromVar} +nx::test new -cmd {c explicitReturn} +nx::test new -cmd {c implicitReturn} +nx::test new -cmd {c explicitReturnFromVar} +nx::test new -cmd {c implicitReturnFromVar} -Test new -cmd {llength [Object info instances]} -count 1 -expected $ocount -Test new -cmd {set x [llength [Object info instances]]} -count 1 -expected $ocount +nx::test new -cmd {llength [Object info instances]} -count 1 -expected $ocount +nx::test new -cmd {set x [llength [Object info instances]]} -count 1 -expected $ocount -Test new -cmd {c childNodeNamespace} -expected ::c::13 -Test new -cmd {llength [Object info instances]} -count 1 -expected $ocount -Test new -cmd {c childNodeNamespaceCreate} -expected ::c::13 -Test new -cmd {llength [Object info instances]} -expected $ocount -Test new -cmd {c createVolatileRc} -expected 2 +nx::test new -cmd {c childNodeNamespace} -expected ::c::13 +nx::test new -cmd {llength [Object info instances]} -count 1 -expected $ocount +nx::test new -cmd {c childNodeNamespaceCreate} -expected ::c::13 +nx::test new -cmd {llength [Object info instances]} -expected $ocount +nx::test new -cmd {c createVolatileRc} -expected 2 # should be still the same number as above -Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +nx::test new -count 1 -cmd {llength [Object info instances]} -expected $ocount -Test new -cmd {Object new -volatile} -expected ::nsf::__\#F9 -count 2000 \ +nx::test new -cmd {Object new -volatile} -expected ::nsf::__\#F9 -count 2000 \ -post {foreach o [Object info instances ::nsf::__*] {$o destroy}} # should be still the same number as above -Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +nx::test new -count 1 -cmd {llength [Object info instances]} -expected $ocount -Test new -cmd {Object new} -expected ::nsf::__\#lQ -count 2000 \ +nx::test new -cmd {Object new} -expected ::nsf::__\#lQ -count 2000 \ -post {foreach o [Object info instances ::nsf::__*] {$o destroy}} # should be still the same number as above -Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +nx::test new -count 1 -cmd {llength [Object info instances]} -expected $ocount -Test new -cmd {Object new -childof o} -expected ::o::__\#0Hh \ +nx::test new -cmd {Object new -childof o} -expected ::o::__\#0Hh \ -pre {Object o} -post {o destroy} # should be still the same number as above -Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +nx::test new -count 1 -cmd {llength [Object info instances]} -expected $ocount -Test new -count 1000 -pre {::set ::count 0} \ +nx::test new -count 1000 -pre {::set ::count 0} \ -cmd {Object create [incr ::count]} \ -expected ::1 \ -post {::unset ::count} -Test new -count 1000 -pre {::set ::count 0} \ +nx::test new -count 1000 -pre {::set ::count 0} \ -cmd {[incr ::count] destroy} \ -post {::unset ::count} \ -expected "" # -Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +nx::test new -count 1 -cmd {llength [Object info instances]} -expected $ocount # we create another object set ocount [expr {$ocount + 1}] -Test new -cmd {Object create x} -expected ::x -Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +nx::test new -cmd {Object create x} -expected ::x +nx::test new -count 1 -cmd {llength [Object info instances]} -expected $ocount -Test new -cmd {Object create x -set a -1 -set b ,, -set c a--} \ +nx::test new -cmd {Object create x -set a -1 -set b ,, -set c a--} \ -expected ::x -Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +nx::test new -count 1 -cmd {llength [Object info instances]} -expected $ocount -Test new -cmd {expr {[c array names n 5] ne ""}} +nx::test new -cmd {expr {[c array names n 5] ne ""}} -Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount -Test new -cmd {info exists c::n(5)} -Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount -Test new -cmd {c exists n(5)} +nx::test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +nx::test new -cmd {info exists c::n(5)} +nx::test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +nx::test new -cmd {c exists n(5)} -Test new -cmd {llength [c info children]} -expected $ccount -Test new -cmd {c info children ::c::5} -expected ::c::5 -Test new -cmd {c info children 5} -expected ::c::5 -Test new -cmd {c info children 5*} -expected ::c::5 +nx::test new -cmd {llength [c info children]} -expected $ccount +nx::test new -cmd {c info children ::c::5} -expected ::c::5 +nx::test new -cmd {c info children 5} -expected ::c::5 +nx::test new -cmd {c info children 5*} -expected ::c::5 -Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount +nx::test new -count 1 -cmd {llength [Object info instances]} -expected $ocount -Test new -cmd {Object info instances ::c::5*} -expected ::c::5 -Test new -cmd {Object info instances ::c::5} -expected ::c::5 -Test new -cmd {Object info instances ::c::5000} -expected "" +nx::test new -cmd {Object info instances ::c::5*} -expected ::c::5 +nx::test new -cmd {Object info instances ::c::5} -expected ::c::5 +nx::test new -cmd {Object info instances ::c::5000} -expected "" -Test new -count 100 -pre {set ::c::l ""} \ +nx::test new -count 100 -pre {set ::c::l ""} \ -cmd {lappend ::c::l 1} \ -post {c unset l} -Test new \ +nx::test new \ -count 100 \ -cmd {c mixinappend M1} \ -expected ::M1 \ -post {c mixin ""} -Test new \ +nx::test new \ -count 100 \ -cmd {c ma M1} \ -expected ::M1 \ -post {c mixin ""} -Test new \ +nx::test new \ -count 100 \ -cmd {c mixin add M1} \ -expected "::M1" \ -post {c mixin ""} -Test new \ +nx::test new \ -count 100 \ -cmd {c mixinappend M1; c mixinappend M2} \ -expected {::M1 ::M2} \ -post {c mixin ""} -Test new \ +nx::test new \ -count 100 \ -cmd {c ma M1; c ma M2} \ -expected {::M1 ::M2} \ -post {c mixin ""} -Test new \ +nx::test new \ -count 100 \ -pre {Class D; Class E; Object o -mixin {D E}} \ -cmd {o info mixin D} \ -expected {::D} \ -post {foreach o {D E o} {$o destroy}} -Test new \ +nx::test new \ -count 100 \ -pre {Class D; Class E; Object o -mixin {D E}} \ -cmd {o info mixin E} \ -expected {::E} \ -post {foreach o {D E o} {$o destroy}} -Test new \ +nx::test new \ -count 100 \ -pre {Class D; Class E; Object o -mixin {D E}} \ -cmd {o info mixin ::E*} \ -expected {::E} \ -post {foreach o {D E o} {$o destroy}} -Test new \ +nx::test new \ -count 100 \ -pre {Class D; Class E; Class E1; Object o -mixin {D E E1}} \ -cmd {o info mixin ::E*} \ -expected {::E ::E1} \ -post {foreach o {D E E1 o} {$o destroy}} -Test new \ +nx::test new \ -count 100 \ -pre {Class D; Class E; Class X -instmixin {D E}} \ -cmd {X info instmixin D} \ -expected {::D} \ -post {foreach o {D E X} {$o destroy}} -Test new \ +nx::test new \ -count 100 \ -pre {Class D; Class E; Class X -instmixin {D E}} \ -cmd {X info instmixin E} \ -expected {::E} \ -post {foreach o {D E X} {$o destroy}} -Test new \ +nx::test new \ -count 100 \ -pre {Class D; Class E; Class E1; Class X -instmixin {D E E1}} \ -cmd {X info instmixin ::E*} \ -expected {::E ::E1} \ -post {foreach o {D E E1 X} {$o destroy}} -Test new \ +nx::test new \ -count 100 \ -pre {Class D; Class E; Class X -instmixin {D E}} \ -cmd {X info instmixin ::E*} \ -expected {::E} \ -post {foreach o {D E X} {$o destroy}} -Test new \ +nx::test new \ -count 100 \ -pre {Class D; Class E; Class X} \ -cmd {X instmixin {D E}; X instmixin delete ::E; X info instmixin} \ -expected {::D} \ -post {foreach o {D E X} {$o destroy}} -Test new \ +nx::test new \ -count 100 \ -pre {Class D; Class E; Class X} \ -cmd {X instmixin {D E}; X instmixin delete E; X info instmixin} \ -expected {::D} \ -post {foreach o {D E X} {$o destroy}} -Test new \ +nx::test new \ -count 100 \ -pre {Class D; Class E; Class E1; Class X} \ -cmd {X instmixin {D E E1}; catch {X instmixin delete ::E*}; X info instmixin} \ -expected {::D} \ -post {foreach o {D E E1 X} {$o destroy}} -Test new \ +nx::test new \ -count 100 \ -pre {Class D; Class E; Class E1; Class X} \ -cmd {X instmixin {D E E1}; catch {X instmixin delete E*}; X info instmixin} \ -expected {::D} \ -post {foreach o {D E E1 X} {$o destroy}} -Test new \ +nx::test new \ -cmd {C instfilter f; C info instfilter} \ -expected f \ -post {C instfilter ""} -Test new -pre {set s \#hallo} -cmd {string match "\#*" $s} -Test new -pre {set s \#hallo} -cmd {regexp {^\#} $s} -Test new -pre {set s \#hallo} -cmd {expr {[string first "\#" $s] == 0}} -Test new -pre {set s \#hallo} -cmd {expr {[string range $s 0 0] == "\#"}} +nx::test new -pre {set s \#hallo} -cmd {string match "\#*" $s} +nx::test new -pre {set s \#hallo} -cmd {regexp {^\#} $s} +nx::test new -pre {set s \#hallo} -cmd {expr {[string first "\#" $s] == 0}} +nx::test new -pre {set s \#hallo} -cmd {expr {[string range $s 0 0] == "\#"}} -Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a} $s} -Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a.*o} $s} -Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s} -Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s _} -Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s _ out} +nx::test new -pre {set s \#hallo} -cmd {regexp {^\#.*a} $s} +nx::test new -pre {set s \#hallo} -cmd {regexp {^\#.*a.*o} $s} +nx::test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s} +nx::test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s _} +nx::test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s _ out} -Test new -msg {call proc of subobject directly} \ +nx::test new -msg {call proc of subobject directly} \ -pre {C c2; C c2::o; c2::o proc f a {incr a}} \ -cmd {c2::o::f 10} -expected 11 -count 5000 \ -post {c2 destroy} -Test new -msg {call proc of subobject via dispatch} \ +nx::test new -msg {call proc of subobject via dispatch} \ -pre {C c2; C c2::o; c2::o proc f a {incr a}} \ -cmd {c2::o f 10} -expected 11 -count 5000 \ -post {c2 destroy} -#Test new -msg {call proc of object and subobject via dispatch} \ +#nx::test new -msg {call proc of object and subobject via dispatch} \ # -pre {C c2; C c2::o; c2::o proc f a {incr a}} \ # -cmd {c2 o f 10} -expected 11 -count 5000 \ # -post {c2 destroy} -Test new -msg {dispatch subobject directy via [self]} \ +nx::test new -msg {dispatch subobject directy via [self]} \ -pre {C c2; C c2::o; c2::o proc f a {incr a}; c2 proc t a {[self]::o f $a}} \ -cmd {c2 t 12} -expected 13 -count 5000 \ -post {c2 destroy} -#Test new -msg {dispatch subobject via my} \ +#nx::test new -msg {dispatch subobject via my} \ # -pre {C c2; C c2::o; c2::o proc f a {incr a}; c2 proc t a {my o f $a}} \ # -cmd {c2 t 12} -expected 13 -count 5000 \ # -post {c2 destroy} ###### insttclcmd tests set cnt 10000 -#Test new -msg {call insttclcmd (append) and check created variable} \ +#nx::test new -msg {call insttclcmd (append) and check created variable} \ -pre {Object o} \ -cmd {o append X 1; o exists X} -expected 1 \ -post {o destroy} -#Test new -msg {call tclcmd (regexep) and check created variable} \ +#nx::test new -msg {call tclcmd (regexep) and check created variable} \ -pre {Object o; o tclcmd regexp} \ -cmd {o regexp (a) a _ x; o exists x} -expected 1 -count $cnt \ -post {o destroy} -Test new -msg {call forwarder for (append) and check created variable} \ +nx::test new -msg {call forwarder for (append) and check created variable} \ -pre {Object o; o forward append -objscope} \ -cmd {o append X 1; o exists X} -expected 1 \ -post {o destroy} -Test new -msg {call forwarder (regexep) and check created variable} \ +nx::test new -msg {call forwarder (regexep) and check created variable} \ -pre {Object o; o forward regexp -objscope} \ -cmd {o regexp (a) a _ x; o exists x} -expected 1 -count $cnt \ -post {o destroy} -Test new -msg {call forwarder to another obj} \ +nx::test new -msg {call forwarder to another obj} \ -pre {Object o; Object t; o forward set t set; t set x 100} \ -cmd {o set x} -expected 100 -count $cnt \ -post {o destroy} set cnt 100000 -Test new -msg {call handcoded incr} \ +nx::test new -msg {call handcoded incr} \ -pre {Class C; C create o; o set x 1} \ -cmd {o incr x 77} -expected 78 -count $cnt \ -post {o destroy} -Test new -msg {call incr via instforward} \ +nx::test new -msg {call incr via instforward} \ -pre {Class C; C instforward ::incr -objscope; C create o; o set x 1} \ -cmd {o incr x 77} -expected 78 -count $cnt \ -post {o destroy} -Test new -msg {call incr via forward} \ +nx::test new -msg {call incr via forward} \ -pre {Class C; C create o; o forward ::incr -objscope; o set x 1} \ -cmd {o incr x 77} -expected 78 -count $cnt \ -post {o destroy} set cnt 10000 -Test new -msg {call obj with namespace via forward} \ +nx::test new -msg {call obj with namespace via forward} \ -pre {Object n; Object n::x; Object o -forward ::n::x} \ -cmd {o x self} -expected ::n::x -count $cnt \ -post {o destroy} -Test new -msg {call obj with namespace via instforward} \ +nx::test new -msg {call obj with namespace via instforward} \ -pre {Object n; Object n::x; Class C; C create o; C instforward ::n::x} \ -cmd {o x self} -expected ::n::x -count $cnt \ -post {o destroy} -Test new -msg {call obj with namespace via instforward and mixinclass} \ +nx::test new -msg {call obj with namespace via instforward and mixinclass} \ -pre {Object n; Object n::x; Class M -instforward ::n::x; Class C -instmixin M; C create o } \ -cmd {o x self} -expected ::n::x -count $cnt \ -post {o destroy} -Test new -msg {call obj with namespace via instforward and next from proc} \ +nx::test new -msg {call obj with namespace via instforward and next from proc} \ -pre { Object n; Object n::x; Class C -instforward ::n::x; C create o -proc x args {next} } \ -cmd {o x self} -expected ::n::x -count $cnt \ -post {o destroy} -Test new -msg {call obj with namespace via instforward and next from instproc} \ +nx::test new -msg {call obj with namespace via instforward and next from instproc} \ -pre { Object n; Object n::x; Class C -instforward ::n::x; Class D -superclass C -instproc x args {next}; D create o } \ -cmd {o x self} -expected ::n::x -count $cnt \ -post {o destroy} -Test new -msg {call obj with namespace via mixin and instforward and next} \ +nx::test new -msg {call obj with namespace via mixin and instforward and next} \ -pre {Object n; Object n::x; Class M -instforward ::n::x; Class N -superclass M -instproc x args {next}; Class C -instmixin N; C create o} \ -cmd {o x self} -expected ::n::x -count $cnt \ -post {o destroy} -Test new -msg {return -code break} \ +nx::test new -msg {return -code break} \ -pre {Class A -instproc br {} {return -code break}; A create a1} \ -cmd {catch {a1 br}} -expected 3 -count 2 \ -post {A destroy; a1 destroy} -Test run; exit +nx::test run; exit Index: library/xotcl/tests/xocomm.test =================================================================== diff -u -r55d0e812c6b2d7895720b83d20addf87d0945c18 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- library/xotcl/tests/xocomm.test (.../xocomm.test) (revision 55d0e812c6b2d7895720b83d20addf87d0945c18) +++ library/xotcl/tests/xocomm.test (.../xocomm.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -66,13 +66,13 @@ # \tstatus-code: \[\[r0 set token\] set responseCode\]" #}}} -nx::Test new -msg "Trying to load image logo-100.jpg ... " -count 1 \ +nx::test new -msg "Trying to load image logo-100.jpg ... " -count 1 \ -verbose 1 \ -pre "puts starting..." \ -setResult {expr {[r0::sink set contentLength] == 1706}} \ -cmd [list SimpleRequest r0 -url http://$hostport/logo-100.jpg] \ -nx::Test new -msg "Trying to PUT a file on web-server ... " -count 1 \ +nx::test new -msg "Trying to PUT a file on web-server ... " -count 1 \ -setResult {expr [[r0 set token] set responseCode] == 201} \ -pre [list file delete -force $dir/../doc/junk.junk] \ -cmd [list SimpleRequest r0 \ @@ -81,31 +81,31 @@ -data "this is a test\n" \ -contentType plain/text] -nx::Test new -msg "And download it again ... " -count 1 \ +nx::test new -msg "And download it again ... " -count 1 \ -setResult {expr [r0 getContentLength] == 15} \ -post {file delete -force ../doc/junk.junk} \ -cmd [list SimpleRequest r0 -url http://$hostport/junk.junk] -nx::Test new -msg "Get protected resource ... " -count 1 \ +nx::test new -msg "Get protected resource ... " -count 1 \ -setResult {expr [r0 getContentLength] > 500} \ -cmd [list SimpleRequest r0 -url http://$protectedhostport/ ] -#nx::Test new -msg "Try an FTP request $ftpURL ... " -count 1 \ +#nx::test new -msg "Try an FTP request $ftpURL ... " -count 1 \ -setResult {expr [r0 getContentLength] > 100} \ -cmd [list SimpleRequest r0 -url $ftpURL] -#nx::Test new -msg "Try timeout with slow URL $slowURL ... " -count 1 \ +#nx::test new -msg "Try timeout with slow URL $slowURL ... " -count 1 \ -setResult {expr {[[r0 set token] set errormsg] == {timeout exceeded}}} \ -cmd [list SimpleRequest r0 -url $slowURL -timeout 100] -nx::Test new -msg terminate -count 1 \ +nx::test new -msg terminate -count 1 \ -setResult {set x 1} \ -cmd [list SimpleRequest r0 -url http://$protectedhostport/exit] \ -post {set ::forever 1} #puts stderr "present [package present xotcl::comm::connection]" #puts stderr "versions [package versions xotcl::comm::connection]" -after 1000 {nx::Test run} +after 1000 {nx::test run} catch {vwait forever} Index: tests/alias.test =================================================================== diff -u -rd79efb10b92ad2045196990af50bc042e60b88f4 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/alias.test (.../alias.test) (revision d79efb10b92ad2045196990af50bc042e60b88f4) +++ tests/alias.test (.../alias.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -5,8 +5,8 @@ #::nx::configure defaultMethodCallProtection false -nx::Test parameter count 10 -nx::Test case alias-preliminaries { +nx::test configure -count 10 +nx::test case alias-preliminaries { # The system methods of nx::VariableSlot are either alias or forwarders ? {lsort [::nx::VariableSlot info methods -type alias]} {assign get} @@ -37,7 +37,7 @@ } -nx::Test case alias-simple { +nx::test case alias-simple { # define an alias and retrieve its definition nx::Class create Base { :public method foo {{-x 1}} {return $x} @@ -76,7 +76,7 @@ ? {Foo info methods -type alias} {} "removed" } -nx::Test case alias-chaining { +nx::test case alias-chaining { # # chaining aliases # @@ -180,7 +180,7 @@ ? {lsort [T info object methods]} {ZAP bar} } -nx::Test case alias-per-object { +nx::test case alias-per-object { nx::Class create T { :public object method bar args { return [current class]->[current method] } @@ -239,7 +239,7 @@ # namespaced procs + namespace deletion -nx::Test case alias-namespaced { +nx::test case alias-namespaced { nx::Class create T { :public object method bar args { return [current class]->[current method] } :create t @@ -291,7 +291,7 @@ # dot-resolver/ dot-dispatcher used in aliased proc -nx::Test case alias-dot-resolver { +nx::test case alias-dot-resolver { nx::Class create V { set :z 1 @@ -324,7 +324,7 @@ ? {lsort [V info object methods]} {FOO2 bar} } -nx::Test case alias-store +nx::test case alias-store # # Tests for the ::nsf::method::alias store, used for introspection for # aliases. The alias store (an associative variable) is mostly @@ -458,7 +458,7 @@ # Check resolving of namespace imported classes # and when a class is aliased via "interp alias" # -nx::Test case class-resolve { +nx::test case class-resolve { namespace eval ::ns1 { nx::Class create A {:public method foo {} {::nx::current class}} nx::Class create B {:public method foo {} {::nx::current class}} @@ -483,8 +483,8 @@ } } -nx::Test parameter count 10 -nx::Test case proc-alias { +nx::test configure -count 10 +nx::test case proc-alias { nx::Class create C { :public method foo {} {upvar x y; info exists y} @@ -555,8 +555,8 @@ return ${:z} } -nx::Test parameter count 10 -nx::Test case proc-alias-compile { +nx::test configure -count 10 +nx::test case proc-alias-compile { nx::Object create o { set :a 100 @@ -601,8 +601,8 @@ # # test redefinition of a target proc # -nx::Test parameter count 1 -nx::Test case alias-proc-refetch { +nx::test configure -count 1 +nx::test case alias-proc-refetch { # # initial definition @@ -621,8 +621,8 @@ # # test registration of a pre-compiled proc # -nx::Test parameter count 1 -nx::Test case alias-precompiled-proc { +nx::test configure -count 1 +nx::test case alias-precompiled-proc { nx::Class create C { :public method vars {} { set result [list] @@ -673,7 +673,7 @@ # Testing aliases to objects and reference counting. # Check the effects via MEM_COUNT... # -nx::Test case refcount-object-alias-recreate1 { +nx::test case refcount-object-alias-recreate1 { # # alias recreate with the same object # @@ -702,7 +702,7 @@ } } -nx::Test case refcount-object-alias-recreate2 { +nx::test case refcount-object-alias-recreate2 { # # alias recreate with a proc # @@ -716,7 +716,7 @@ } } -nx::Test case refount-destroy-delete1 { +nx::test case refount-destroy-delete1 { nx::Object create ::x nx::Object create ::o {:object alias X ::x} @@ -742,7 +742,7 @@ ? {::o object alias X ::x} "::o::X" } -nx::Test case refount-destroy-delete2 { +nx::test case refount-destroy-delete2 { nx::Object create ::o nx::Object create ::baff nx::Object create ::baff::child @@ -768,7 +768,7 @@ # # Testing cylcic alias # -nx::Test case cyclic-alias { +nx::test case cyclic-alias { nx::Object create o { set handle [:public object method foo {} {return 1}] # we can define currently the recursive definition Index: tests/cget.test =================================================================== diff -u -r7ba7b3c49ff542688258f50fba2fc8102f23a011 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/cget.test (.../cget.test) (revision 7ba7b3c49ff542688258f50fba2fc8102f23a011) +++ tests/cget.test (.../cget.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -5,7 +5,7 @@ # # The first test set checks just the basic behavior: # -nx::Test case cget-simple { +nx::test case cget-simple { nx::Class create Person { :property famnam:required @@ -61,8 +61,8 @@ # methods "assign" and "get". # -nx::Test parameter count 1 -nx::Test case cget-via-slot { +nx::test configure -count 1 +nx::test case cget-via-slot { nx::Class create C { @@ -122,7 +122,7 @@ # The third test set checks method binding to parameter: # All cmds are supposed to return resonable values. # -nx::Test case cget-parameter-methods { +nx::test case cget-parameter-methods { nx::Class create C { :property {foo:alias,method=m0 {1 2 3}} :property {{bar:forward,method=%self m1 a b c %method} bar1} @@ -175,8 +175,8 @@ # # The fourth test set checks performance of "cget" and "configure". # -nx::Test parameter count 10000 -nx::Test case cget-performance { +nx::test configure -count 10000 +nx::test case cget-performance { nx::Class create Person { :property famnam:required @@ -220,8 +220,8 @@ } -nx::Test parameter count 1 -nx::Test case configure-trace-class { +nx::test configure -count 1 +nx::test case configure-trace-class { # # class case with no default @@ -259,7 +259,7 @@ ? {c2 cget -q} "102" } -nx::Test case configure-trace-object { +nx::test case configure-trace-object { # # object case with no default # @@ -299,7 +299,7 @@ -nx::Test case configure-trace-class-type { +nx::test case configure-trace-class-type { # # class case with type and no default @@ -355,7 +355,7 @@ } -nx::Test case configure-trace-object-type { +nx::test case configure-trace-object-type { # # object case with no default # Index: tests/class-method.test =================================================================== diff -u -r471c9589c601e576f2bc5f3e2dd4c554a0ceee1c -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/class-method.test (.../class-method.test) (revision 471c9589c601e576f2bc5f3e2dd4c554a0ceee1c) +++ tests/class-method.test (.../class-method.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -4,7 +4,7 @@ # # The first test series without the conveniance layer # -nx::Test case class-methods-0 { +nx::test case class-methods-0 { nx::Class create M1 nx::Class create C { ? {::C public class method foo {} {return foo}} "'class' is not a method defining method" @@ -28,7 +28,7 @@ nx::configure class-method-warning on -nx::Test case class-methods-1 { +nx::test case class-methods-1 { nx::Class create M1 nx::Class create ::C { :public class method foo {} {return [:pm1]} @@ -82,7 +82,7 @@ # # delete class method, class property, class variable # -nx::Test case class-methods-2 { +nx::test case class-methods-2 { nx::Class create ::C { :public class method foo {} {return foo} :class property -accessor public p @@ -110,7 +110,7 @@ # require method # -nx::Test case class-methods-2 { +nx::test case class-methods-2 { nsf::method::provide set {::nsf::method::alias set -frame object ::set} Index: tests/destroy.test =================================================================== diff -u -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/destroy.test (.../destroy.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ tests/destroy.test (.../destroy.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -1,16 +1,13 @@ # -*- Tcl -*- package require nx -package require nx::plain-object-method +package require nx::test +nx::test configure -count 10 ::nx::configure defaultMethodCallProtection false -package require nx::test -namespace import ::nx::* -Test parameter count 10 - ::nsf::method::alias ::nx::Object set -frame object ::set -Class create O -superclass Object { +nx::Class create O -superclass nx::Object { :method init {} { set ::ObjectDestroy 0 set ::firstDestroy 0 @@ -26,8 +23,8 @@ # classical simple case # set case "simple destroy (1)" -Test case simple-destroy-1 -Class create C -superclass O +nx::test case simple-destroy-1 +nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy"; next} C method foo {} { puts stderr "==== $::case [current]" @@ -50,8 +47,8 @@ # simple case, destroy does not propagate, c1 survives # set case "simple destroy (2), destroy blocks" -Test case simple-destroy-2 -Class create C -superclass O +nx::test case simple-destroy-2 +nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy block"} C method foo {} { puts stderr "==== $::case [current]" @@ -74,8 +71,8 @@ # simple object recreate # set case "recreate" -Test case recreate -Class create C -superclass O +nx::test case recreate +nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy"; next} C method foo {} { puts stderr "==== $::case [current]" @@ -98,9 +95,9 @@ # .. like simple case above # set case "cmd rename empty (1)" -Test case rename-empty-1 -Object create o -Class create C -superclass O +nx::test case rename-empty-1 +nx::Object create o +nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy"; next} C method foo {} { puts stderr "==== $::case [current]" @@ -125,8 +122,8 @@ # this is the situation like above, as long xotcl's rename is used. # set case "cmd rename empty (2)" -Test case rename-empty-2 -Class create C -superclass O +nx::test case rename-empty-2 +nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy block"} C method foo {} { puts stderr "==== $::case [current]" @@ -151,9 +148,9 @@ # xotcl's rename invokes a move # set case "cmd rename object to current" -Test case rename-to-current -Object create o -Class create C -superclass O +nx::test case rename-to-current +nx::Object create o +nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy"; next} C method foo {} { puts stderr "==== $::case [current]" @@ -177,9 +174,9 @@ # xotcl's rename invokes a move # set case "cmd rename proc to current" -Test case rename-proc-to-current +nx::test case rename-proc-to-current proc o args {} -Class create C -superclass O +nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy"; next} C method foo {} { puts stderr "==== $::case [current]" @@ -202,9 +199,9 @@ # set case "delete parent namespace (1)" -Test case delete-parent-namespace +nx::test case delete-parent-namespace namespace eval ::test { - Class create C -superclass O + nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy"; next} C method foo {} { puts stderr "==== $::case [current]" @@ -242,10 +239,10 @@ # propagate. # set case "delete parent namespace (2)" -Test case delete-parent-namespace-2 +nx::test case delete-parent-namespace-2 namespace eval ::test { ? {namespace exists test::C} 0 "exists test::C" - Class create C -superclass O + nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy block"} C method foo {} { puts stderr "==== $::case [current]" @@ -278,9 +275,9 @@ # already deleted, while a method of it is excuted # set case "delete parent object (1)" -Test case delete-parent-object -Object create o -Class create C -superclass O +nx::test case delete-parent-object +nx::Object create o +nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy"; next} C method foo {} { puts stderr "==== $::case [current]" @@ -310,9 +307,9 @@ # is deleted. # set case "delete parent object (2)" -Test case delete-parent-object-2 -Object create o -Class create C -superclass O +nx::test case delete-parent-object-2 +nx::Object create o +nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy block"} C method foo {} { puts stderr "==== $::case [current]" @@ -338,9 +335,9 @@ # xotcl 1.6 crashed on this test # set case "redefine current object as proc" -Test case redefine-current-object-as-proc -Object create o -Class create C -superclass O +nx::test case redefine-current-object-as-proc +nx::Object create o +nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy"; next} C method foo {} { puts stderr "==== $::case [current]" @@ -366,8 +363,8 @@ # delete the active class # set case "delete active class" -Test case delete-active-class -Class create C -superclass O +nx::test case delete-active-class +nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy"; next} C method foo {} { puts stderr "==== $::case [current]" @@ -396,8 +393,8 @@ # delete active object nested in class # set case "delete active object nested in class" -Test case delete-active-object-nested-in-class -Class create C -superclass O +nx::test case delete-active-object-nested-in-class +nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy"; next} C method foo {} { puts stderr "==== $::case [current]" @@ -424,22 +421,22 @@ ? "set ::ObjectDestroy" 1 "ObjectDestroy called" # -Test case nesting-destroy { - Object create x - Object create x::y +nx::test case nesting-destroy { + nx::Object create x + nx::Object create x::y x destroy ? {::nsf::object::exists x} 0 "parent object gone" ? {::nsf::object::exists x::y} 0 "child object gone" } -Test case deleting-aliased-object1 { - Object create o - Object create o2 +nx::test case deleting-aliased-object1 { + nx::Object create o + nx::Object create o2 # behave like an ensemble: aliased object has self of the caller ::nsf::object::property o2 perobjectdispatch 1 ::nsf::method::alias o a o2 ? {o a} ::o2 "call object via alias" - ? {o info method type a} alias + ? {o info object method type a} alias ## the ensemble-object needs per-object methods o2 object method info args {:info {*}$args} o2 object method set args {:set {*}$args} @@ -456,16 +453,16 @@ ? {o a info vars} {target "o2" of alias a apparently disappeared} "2nd call on deleted object" } -Test case deleting-aliased-object2 { - Object create o - Object create o2 +nx::test case deleting-aliased-object2 { + nx::Object create o + nx::Object create o2 # The methods of the aliased object have their own self ::nsf::method::alias o a o2 puts stderr ===5 ? {o a} ::o2 "call object via alias" puts stderr ===6 - ? {o info method type a} alias + ? {o info object method type a} alias # In order to avoid recursive calls, we have to provide the # selector for the method definitions in nx::Object o2 object method info args {: ::nsf::classes::nx::Object::info {*}$args} @@ -485,9 +482,9 @@ } set case "deleting object with alias to object" -Test case deleting-object-with-alias-to-object -Object create o -Object create o3 +nx::test case deleting-object-with-alias-to-object +nx::Object create o +nx::Object create o3 ::nsf::method::alias o x o3 o destroy ? {::nsf::object::exists o} 0 "parent object gone" @@ -496,9 +493,9 @@ ? {::nsf::object::exists o3} 0 "aliased object destroyed" set case "create an alias, and delete cmd via aggregation" -Test case create-alias-delete-via-aggregation -Object create o -Object create o3 +nx::test case create-alias-delete-via-aggregation +nx::Object create o +nx::Object create o3 ::nsf::method::alias o x o3 #o::x destroy o3 destroy @@ -510,11 +507,11 @@ # # create an alias, and recreate obj # -Test case create-alias-and-recreate-obj { - Object create o - Object create o3 +nx::test case create-alias-and-recreate-obj { + nx::Object create o + nx::Object create o3 o object alias x o3 - Object create o3 + nx::Object create o3 o3 object method set args {: ::nsf::classes::nx::Object::set {*}$args} o x set a 13 ? {o x set a} 13 "aliased object works after recreate" @@ -524,10 +521,10 @@ # create an alias on the class level, double aliasing, delete aliased # object # -Test case create-alias-on-class-delete-aliased-obj { - Class create C - Object create o - Object create o3 +nx::test case create-alias-on-class-delete-aliased-obj { + nx::Class create C + nx::Object create o + nx::Object create o3 ::nsf::object::property o keepcallerself 1 ::nsf::object::property o3 keepcallerself 1 @@ -553,10 +550,10 @@ # # create an alias on the class level, double aliasing, destroy class # -Test case create-alias-on-class-destroy-class { - Class create C - Object create o - Object create o3 +nx::test case create-alias-on-class-destroy-class { + nx::Class create C + nx::Object create o + nx::Object create o3 o object alias a o3 C alias b o C create c1 @@ -569,12 +566,12 @@ # test cases where preexisting namespaces are re-used # -Test case module { +nx::test case module { # create a namespace with an object/class in it - namespace eval ::module { Object create foo } + namespace eval ::module { nx::Object create foo } # reuse the namespace for a class/object - Class create ::module + nx::Class create ::module ? {::nsf::is class ::module} 1 @@ -584,23 +581,23 @@ ? {::nsf::is class ::module} 0 } -Test case namespace-import { +nx::test case namespace-import { namespace eval ::module { - Class create Foo { + nx::Class create Foo { :create foo } namespace export Foo foo } - Class create ::module { + nx::Class create ::module { :create mod1 } ? {::nsf::is class ::module::Foo} 1 ? {::nsf::is class ::module::foo} 0 ? {::nsf::object::exists ::module::foo} 1 ? {::nsf::is class ::module} 1 - Object create ::o { :require namespace } + nx::Object create ::o { :require namespace } namespace eval ::o {namespace import ::module::*} ? {::nsf::is class ::o::Foo} 1 @@ -621,9 +618,10 @@ # to avoid CallDirectly, we could activate this line ::nx::Class create M {:method dealloc args {next}} -Test case delete-parent-namespace-dealloc + +nx::test case delete-parent-namespace-dealloc namespace eval ::test { - Class create C -superclass O + nx::Class create C -superclass O C method destroy {} {incr ::firstDestroy; puts stderr " *** [current] destroy"; next} C method foo {} { puts stderr "==== $::case [current]" @@ -642,6 +640,7 @@ ? "set ::ObjectDestroy" 0 "$::case destroy not yet called" } } + test::C create test::c1 test::c1 foo ? {::nsf::object::exists test::c1} 0 "object still exists after proc" @@ -652,7 +651,7 @@ ? {namespace exists ::test} 1 "parent ::test namespace still exists after proc" ? {namespace exists ::xotcl::classes::test::C} 0 "namespace ::xotcl::classes::test::C still exists after proc" -Test case destroy-during-init { +nx::test case destroy-during-init { # create class nx::Class create Foo { :public method bar {} {return 1} @@ -717,7 +716,7 @@ ::nx::Object filter "" } -Test case nested-ordered-composite { +nx::test case nested-ordered-composite { # The following test case an explicit deletion/redefinition of an # toplevel object (o1) will cause the implicit deletion of a nested # object o1::o2. The object o2 has as well several included objects, @@ -728,7 +727,7 @@ # confronted with the deletion of indirectly deleted items (deleted by # the deletion of the ordered composite). - Class create C { + nx::Class create C { :property os :public method destroy {} { #puts stderr "[self] destroy ${:os}" @@ -752,9 +751,9 @@ for {set i 0} {$i < 10} {incr i} { set os [list] for {set j 0} {$j < 10} {incr j} {lappend os ::o1::o2::[incr c]} - Object create ::o1 - Object create ::o1::o2 - foreach o $os {Object create $o} + nx::Object create ::o1 + nx::Object create ::o1::o2 + foreach o $os {nx::Object create $o} C create ::o1::o2::oc1 -os $os ? {llength [o1 info children]} 1 ? {llength [o1::o2 info children]} 11 @@ -772,9 +771,9 @@ for {set i 0} {$i < 10} {incr i} { set os [list] for {set j 0} {$j < 20} {incr j} {lappend os ::o1::o2::[incr c]} - Object create ::o1 - Object create ::o1::o2 - foreach o $os {Object create $o} + nx::Object create ::o1 + nx::Object create ::o1::o2 + foreach o $os {nx::Object create $o} C create ::o1::o2::oc1 -os $os ? {llength [o1 info children]} 1 ? {llength [o1::o2 info children]} 21 @@ -785,9 +784,9 @@ for {set i 0} {$i < 10} {incr i} { set os [list] for {set j 0} {$j < 20} {incr j} {lappend os ::o1::o2::[incr c]} - Object create ::o1 - Object create ::o1::o2 - foreach o $os {Object create $o} + nx::Object create ::o1 + nx::Object create ::o1::o2 + foreach o $os {nx::Object create $o} C create ::o1::o2::ocX -os {} C create ::o1::o2::ocY -os $os ? {llength [o1 info children]} 1 @@ -802,9 +801,9 @@ # package req nx::serializer -nx::Test case class-object-property { +nx::test case class-object-property { - Class create C { + nx::Class create C { :object property -accessor public x :property a:int } @@ -831,7 +830,7 @@ ? {::nsf::object::exists ::C} 0 } -nx::Test case unset-traces-during-cleanup { +nx::test case unset-traces-during-cleanup { global i set i [interp create] $i eval { @@ -851,7 +850,7 @@ unset i } -nx::Test case unset-traces-during-cleanup-with-destroy { +nx::test case unset-traces-during-cleanup-with-destroy { # # Make sure that a very-late destroy (in the unset trace) does not # fire ... and does not cause any side effects. @@ -879,7 +878,7 @@ unset i } -nx::Test case unset-traces-during-cleanup-with-destroy-2 { +nx::test case unset-traces-during-cleanup-with-destroy-2 { # # We are safe when trying to delete the base class/metaclass ... # @@ -902,7 +901,7 @@ unset i } -nx::Test case unset-traces-during-cleanup-with-reset { +nx::test case unset-traces-during-cleanup-with-reset { # # Check for leaks ... # @@ -928,7 +927,7 @@ # # Exercise renaming of cmds which are used as methods # -nx::Test case rename-cached-method { +nx::test case rename-cached-method { # Create a class with a namespace nx::Class create A {:public object method foo args {}} # @@ -980,7 +979,7 @@ # # Create a cyclical class dependency and delete it manually # -nx::Test case cyclical-dependency { +nx::test case cyclical-dependency { nx::Object create o1 ? {nx::Class create o1::C} ::o1::C ? {nsf::relation o1 class o1::C} ::o1::C @@ -998,7 +997,7 @@ # # Create a cyclical superclass dependency and delete it manually # -nx::Test case cyclical-dependency { +nx::test case cyclical-dependency { nx::Class create C nx::Class create C::* ? {nsf::relation C superclass {C::* nx::Object}} "" Index: tests/disposition.test =================================================================== diff -u -r4c6c39cd6a1aa703a9a8cf7dc89baf7d4a58d6c5 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/disposition.test (.../disposition.test) (revision 4c6c39cd6a1aa703a9a8cf7dc89baf7d4a58d6c5) +++ tests/disposition.test (.../disposition.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -8,7 +8,7 @@ # test cases for disposition "alias" and "forward" # -nx::Test case basics { +nx::test case basics { Class create C { :object property {inst "::__%&singleton"} @@ -318,7 +318,7 @@ ? {C new} "parameter option 'initcmd' not valid in this option combination" } -nx::Test case dispo-multiplicities { +nx::test case dispo-multiplicities { Class create S { :public object method setObjectParams {spec} { :protected method __objectparameter {} [list return $spec] @@ -381,7 +381,7 @@ } -nx::Test case dispo-returns { +nx::test case dispo-returns { Class create R { :public object method setObjectParams {spec} { :protected method __objectparameter {} [list return $spec] @@ -445,7 +445,7 @@ ? {string is wideinteger [[R new -foo t f] eval {set :baz}]} 1 } -nx::Test case dispo-callstack { +nx::test case dispo-callstack { Class create Callee { :public object method setObjectParams {spec} { :protected method __objectparameter {} [list return $spec] @@ -613,7 +613,7 @@ } -nx::Test case alias-noarg { +nx::test case alias-noarg { Class create C { :public object method setObjectParams {spec} { :protected method __objectparameter {} [list return $spec] @@ -754,7 +754,7 @@ # # check inticmd + noarg (should not be allowed) # -nx::Test case alias-noarg { +nx::test case alias-noarg { Class create C { :public object method setObjectParams {spec} { :protected method __objectparameter {} [list return $spec] @@ -769,7 +769,7 @@ # # check alias + args # -nx::Test case alias-args { +nx::test case alias-args { Class create C { :public object method setObjectParams {spec} { :protected method __objectparameter {} [list return $spec] @@ -859,7 +859,7 @@ -nx::Test case alias-init { +nx::test case alias-init { Class create C { :public object method setObjectParams {spec} { :protected method __objectparameter {} [list return $spec] @@ -877,7 +877,7 @@ ? {c1 eval {set :y}} 1 } -nx::Test case submethods-via-aliasparams { +nx::test case submethods-via-aliasparams { # # Could move to submethods.test? # @@ -1080,7 +1080,7 @@ C mixin {} } -nx::Test case dispo-configure-transparency { +nx::test case dispo-configure-transparency { Class create C { :public object method setObjectParams {spec} { :protected method __objectparameter {} [list return $spec] @@ -1169,7 +1169,7 @@ # } -nx::Test case dispo-object-targets { +nx::test case dispo-object-targets { Object create obj ::nsf::object::property obj perobjectdispatch true @@ -1332,7 +1332,7 @@ # check xotcl with residual args # -nx::Test case xotcl-residualargs { +nx::test case xotcl-residualargs { package prefer latest puts stderr "XOTcl loaded: [package req XOTcl 2.0]" @@ -1354,8 +1354,8 @@ } -nx::Test parameter count 1000 -nx::Test case xotcl-residualargs2 { +nx::test configure -count 1000 +nx::test case xotcl-residualargs2 { ::xotcl::Class create XC -parameter {a b c} ::XC instproc init args {set :x $args; incr :y} @@ -1378,7 +1378,7 @@ ? {c1 eval {set :y}} 1 } -nx::Test case xotcl-residualargs-upleveling { +nx::test case xotcl-residualargs-upleveling { # # Test callstack resolution for upvar/uplevel in # parameter-dispatched methods under residualargs() ... Index: tests/doc.test =================================================================== diff -u -r2f6bcca3537584c8ef1f9fc71b230e79d1560504 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/doc.test (.../doc.test) (revision 2f6bcca3537584c8ef1f9fc71b230e79d1560504) +++ tests/doc.test (.../doc.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -7,7 +7,7 @@ namespace import -force ::nx::doc::* -Test parameter count 1 +nx::test configure -count 1 # # some helper Index: tests/forward.test =================================================================== diff -u -rd79efb10b92ad2045196990af50bc042e60b88f4 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/forward.test (.../forward.test) (revision d79efb10b92ad2045196990af50bc042e60b88f4) +++ tests/forward.test (.../forward.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -1,14 +1,13 @@ # -*- Tcl -*- package require nx package require nx::test -namespace import ::nx::* ########################################### # trivial object delegation ########################################### -Test case delegation { - Object create dog - Object create tail { +nx::test case delegation { + nx::Object create dog + nx::Object create tail { :public object method wag args { return $args } } dog public object forward wag tail %proc @@ -20,8 +19,8 @@ ########################################### # evaluating in scope ########################################### -Test case inscope { - Class create X { +nx::test case inscope { + nx::Class create X { :property {x 1} :public forward Incr -objframe incr } @@ -36,8 +35,8 @@ ########################################### # adding ########################################### -Test case adding { - Object create obj { +nx::test case adding { + nx::Object create obj { :public object forward addOne expr 1 + } @@ -47,11 +46,11 @@ ########################################### # more arguments ########################################### -Test case multiple-args { - Object create target { +nx::test case multiple-args { + nx::Object create target { :public object method foo args {return $args} } - Object create obj { + nx::Object create obj { :public object forward foo target %proc %self a1 a2 } @@ -64,12 +63,12 @@ ########################################### # mixin example ########################################### -Test case mixin-via-forward { - Object create mixin { +nx::test case mixin-via-forward { + nx::Object create mixin { :object method unknown {m args} {return [concat [current] $m $args]} } - Object create obj { + nx::Object create obj { :public object forward Mixin mixin %1 %self } @@ -86,8 +85,8 @@ ########################################### # sketching extensibe info ########################################### -Test case info-via-forward { - Object create Info { +nx::test case info-via-forward { + nx::Object create Info { :public object method @mixin {o} { $o info mixin } @@ -99,9 +98,9 @@ return $result } } - Object public forward Info -methodprefix @ Info %1 %self + nx::Object public forward Info -methodprefix @ Info %1 %self - Class create X { + nx::Class create X { :create x1 } ? {x1 Info class} ::X @@ -111,8 +110,8 @@ ########################################### # variations of placement of options ########################################### -Test case incr { - Object create obj { +nx::test case incr { + nx::Object create obj { set :x 1 :public object forward i1 -objframe incr x } @@ -123,8 +122,8 @@ ########################################### # introspeciton options ########################################### -Test case introspection { - Class create C { +nx::test case introspection { + nx::Class create C { :public forward Info -methodprefix @ Info %1 %self } @@ -143,7 +142,7 @@ ? {C info method definition Info} [list ::C public forward Info -methodprefix @ Info %1 %self] # check introspection for objects - Object create obj { + nx::Object create obj { :public object forward i1 -objframe incr x :public object forward Mixin mixin %1 %self :public object forward foo target %proc %self %%self %%p @@ -161,8 +160,8 @@ # test serializer ########################################### package require nx::serializer -Test case serializer { - Object create obj { +nx::test case serializer { + nx::Object create obj { :object method test {} {puts "i am [current method]"} } set ::a [Serializer deepSerialize obj] @@ -174,24 +173,24 @@ ########################################### # test optional target cmd ########################################### -Test case optional-target { - Object create obj { +nx::test case optional-target { + nx::Object create obj { set :x 2 :public object forward append -objframe } ? {obj append x y z} 2yz - Object create n; Object create n::x {:public object method current {} {current}} - Object create o + nx::Object create n; nx::Object create n::x {:public object method current {} {current}} + nx::Object create o o public object forward ::n::x ? {o x current} ::n::x } ########################################### # arg including instvar ########################################### -Test case percent-cmd { - Object create obj { +nx::test case percent-cmd { + nx::Object create obj { set :x 10 :public object forward x* expr {%:eval {set :x}} * } @@ -201,8 +200,8 @@ ########################################### # positional arguments ########################################### -Test case positioning-args { - Object create obj +nx::test case positioning-args { + nx::Object create obj obj public object forward @end-13 list {%@end 13} ? {obj @end-13 1 2 3 } [list 1 2 3 13] @@ -259,8 +258,8 @@ ############################################### # substitution depending on number of arguments ############################################### -Test case num-args { - Object create obj { +nx::test case num-args { + nx::Object create obj { :public object forward f %self [list %argclindex [list a b c]] :object method a args {return [list [current method] $args]} :object method b args {return [list [current method] $args]} @@ -275,21 +274,21 @@ ############################################### # option earlybinding ############################################### -Test case earlybinding { - Object create obj { +nx::test case earlybinding { + nx::Object create obj { #:public object forward s -earlybinding ::set ::X :public object forward s ::set ::X } ? {obj s 100} 100 ? {obj s} 100 - Object public method f args { next } + nx::Object public method f args { next } - Class create NS - Class create NS::Main { + nx::Class create NS + nx::Class create NS::Main { :public object method m1 {} { :m2 } :public object method m2 {} { - ? {namespace eval :: {Object create toplevelObj1}} ::toplevelObj1 + ? {namespace eval :: {nx::Object create toplevelObj1}} ::toplevelObj1 ? [list set _ [namespace current]] ::NS ? [list set _ [NS create m1]] ::NS::m1 @@ -314,7 +313,7 @@ :public method i1 {} { :i2 } :public method i2 {} { - ? {namespace eval :: {Object create toplevelObj2}} ::toplevelObj2 + ? {namespace eval :: {nx::Object create toplevelObj2}} ::toplevelObj2 ? [list set _ [namespace current]] ::NS ? [list set _ [NS create i1]] ::NS::i1 @@ -362,10 +361,10 @@ ########################################### # forward to expr + callstack ########################################### -Test case callstack { - Object public forward expr -objframe +nx::test case callstack { + nx::Object public forward expr -objframe - Class create C { + nx::Class create C { :method xx {} {current} :public object method t {o expr} { return [$o expr $expr] @@ -387,6 +386,6 @@ ? {C t ::c1 {[:info has type C]}} 1 ? {C t ::c1 {[:info has type ::C]}} 1 - Object method expr {} {} + nx::Object method expr {} {} } \ No newline at end of file Index: tests/info-method.test =================================================================== diff -u -r3be87f20ac5f89fac33e2db3b95e80c9adfc92d9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/info-method.test (.../info-method.test) (revision 3be87f20ac5f89fac33e2db3b95e80c9adfc92d9) +++ tests/info-method.test (.../info-method.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -7,7 +7,7 @@ # Test info superclass with closure and patterns (with and without # wildcards, prefixed or not, success or not). # -nx::Test case info-superclass { +nx::test case info-superclass { nx::Class create C nx::Class create D -superclass C @@ -59,7 +59,7 @@ # Test "info method", base cases # -nx::Test case info-method-base { +nx::test case info-method-base { nx::Object create o { :object alias set ::set } @@ -173,7 +173,7 @@ # Test visability of obj-objects # -nx::Test case visability-sub-objects { +nx::test case visability-sub-objects { ::nx::Object create o { ::nx::Object create [::nx::self]::sub { :object method foo {} {;} @@ -192,7 +192,7 @@ # # Test visability of aliased Objects # -nx::Test case visability-aliased-object { +nx::test case visability-aliased-object { ::nx::Object create ::I ::nx::Class create C { :public alias i ::I @@ -230,7 +230,7 @@ ::nx::configure defaultMethodCallProtection false -nx::Test case method-returns { +nx::test case method-returns { # # A test object covering basic cases, adopted from returns.test @@ -273,7 +273,7 @@ ? {c1 info object method returns "bar baf"} "" } -nx::Test case method-definition-with-returns { +nx::test case method-definition-with-returns { # # A test object covering basic cases, adopted from returns.test # @@ -306,7 +306,7 @@ } -nx::Test case copy-with-returns { +nx::test case copy-with-returns { nx::Class create C { # scripted method without paramdefs for in-parameters :method bar-ok1 {a b} -returns integer {;} @@ -354,7 +354,7 @@ ::nx::configure defaultMethodCallProtection $dmcFlag # -- -nx::Test case callable { +nx::test case callable { # define the same method for Object and Class ::nx::Object method bar {} {return Object.bar} ::nx::Class method bar {} {return Class.bar} @@ -458,7 +458,7 @@ # # test info slot objects / info lookup slots # -nx::Test case info-slots { +nx::test case info-slots { nx::Class create C { :property a @@ -488,7 +488,7 @@ # # test info slot objects / info lookup slots # -nx::Test case slots { +nx::test case slots { nx::Class create C { :property a @@ -576,7 +576,7 @@ # # test info submethod and method handles for submethods # -nx::Test case info-submethod { +nx::test case info-submethod { nx::Object create o { :object method "foo a" {} {return a} @@ -703,7 +703,7 @@ # # test info slot parameter|parametersyntax # -nx::Test case info-slot-parametersyntax { +nx::test case info-slot-parametersyntax { nx::Class create C { :property a @@ -740,7 +740,7 @@ # # test "info methods -path" # -nx::Test case info-methods-path { +nx::test case info-methods-path { # # test case on base class # @@ -798,7 +798,7 @@ # # Test parameter syntax for a methods and cmds # -nx::Test case parametersyntax { +nx::test case parametersyntax { # a true method ? {::nx::Class info method syntax method} \ "/cls/ method /name/ /arguments/ ?-returns /value/? /body/ ?-precondition /value/? ?-postcondition /value/?" @@ -812,7 +812,7 @@ # # Test info heritage, base cases # -nx::Test case info-heritage { +nx::test case info-heritage { Class create A Class create B -superclass A Class create BB -superclass B @@ -859,7 +859,7 @@ # # Test transitive per-class mixins # -nx::Test case info-heritage-transitive { +nx::test case info-heritage-transitive { Class create O Class create A -superclass O Class create B -superclass A @@ -900,7 +900,7 @@ # # Test circular mixins # -nx::Test case info-heritage-circular { +nx::test case info-heritage-circular { Class create O Class create A -superclass O Class create B -superclass A @@ -961,7 +961,7 @@ # # Mixin the same class twice, once per-class and one per-object. # -nx::Test case info-heritage-simple-multimix { +nx::test case info-heritage-simple-multimix { Class create Agent Class create MovementTest Class create MovementLog @@ -982,7 +982,7 @@ # Mixin several classes at several class levels and on the object # level # -nx::Test case info-heritage-multimix { +nx::test case info-heritage-multimix { Class create A Class create B -superclass A Class create M1 @@ -1013,7 +1013,7 @@ # # per-object mixin with implied classes # -nx::Test case info-heritage-multimix { +nx::test case info-heritage-multimix { Class create A Class create B -superclass A Class create C @@ -1043,7 +1043,7 @@ # # transitive per-class mixins with implied classes # -nx::Test case info-heritage-transitive-pcm { +nx::test case info-heritage-transitive-pcm { Class create A Class create B -superclass A Class create C -superclass B @@ -1131,7 +1131,7 @@ # # ::nsf::method::ishandle # -nx::Test case method-isregistered { +nx::test case method-isregistered { ? {::nsf::method::registered c} "" ? {::nsf::method::registered info} "" @@ -1168,7 +1168,7 @@ # "handle" alone is the registration handle. # -nx::Test case method-origin { +nx::test case method-origin { nx::Class create C ? {set implHandle [C public method "foo bar" {x} {;}]} "::C::slot::__foo::bar" ? {set regHandle [C info method registrationhandle "foo bar"]} "::nsf::classes::C::foo bar" @@ -1188,7 +1188,7 @@ # test "info methods -closure" # -nx::Test case info-methods-closure { +nx::test case info-methods-closure { nx::Class create C { :public method c1 {} {...} :method c2 {} {...} @@ -1226,6 +1226,6 @@ # # Test error messages within an ensemble call # -nx::Test case error-in-ensemble { +nx::test case error-in-ensemble { ? {nx::Object info method definition foo 1} {wrong # args: should be "definition name"} } \ No newline at end of file Index: tests/info-variable.test =================================================================== diff -u -r3be87f20ac5f89fac33e2db3b95e80c9adfc92d9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/info-variable.test (.../info-variable.test) (revision 3be87f20ac5f89fac33e2db3b95e80c9adfc92d9) +++ tests/info-variable.test (.../info-variable.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -23,7 +23,7 @@ # /obj/ info parameter list|name|syntax /param/ -> value # /obj/ info variable definition|name|parameter /handle/ -> value # -nx::Test case configure-parameters { +nx::test case configure-parameters { nx::Class create Person { :property name :property age:integer @@ -193,7 +193,7 @@ } -nx::Test case object-variables { +nx::test case object-variables { nx::Class create Bar { :property {p 9} } Index: tests/interceptor-slot.test =================================================================== diff -u -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/interceptor-slot.test (.../interceptor-slot.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ tests/interceptor-slot.test (.../interceptor-slot.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -2,19 +2,17 @@ package require nx package require nx::test -namespace import ::nx::* - -Class create M { +nx::Class create M { :method mfoo {} {puts [self proc]} } -Class create M2 -Class create C +nx::Class create M2 +nx::Class create C C create c1 # # test mixin method # -Test case mixin-method { +nx::test case mixin-method { ? {C info lookup method mixin} "::nsf::classes::nx::Class::mixin" ? {C mixin M} ::M ? {C info precedence} "::nx::Class ::nx::Object" @@ -35,7 +33,7 @@ # # test nsf::mixin interface # -Test case nsf-mixin { +nx::test case nsf-mixin { ? {::nsf::mixin C ::M} "::M" ? {C info mixin classes} "::M" ? {::nsf::mixin C ::M2} "::M2 ::M" @@ -47,7 +45,7 @@ # # per-object mixins # -Test case per-object-mixin { +nx::test case per-object-mixin { ? {c1 info precedence} "::C ::nx::Object" ? {c1 object mixin add M} ::M ? {::nsf::relation c1 object-mixin} ::M @@ -69,7 +67,7 @@ # adding, removing per-object mixins for classes through relation # "object-mixin" # -Test case object-mixin-relation { +nx::test case object-mixin-relation { ? {::nsf::relation C object-mixin M} ::M ? {C info precedence} "::M ::nx::Class ::nx::Object" ? {C info object mixin classes} "::M" @@ -91,7 +89,7 @@ # add and remove object mixin for classes via modifier "object" and # "mixin" # -Test case class+mixin { +nx::test case class+mixin { ? {C object mixin M} ::M ? {C info precedence} "::M ::nx::Class ::nx::Object" ? {C info object mixin classes} "::M" @@ -102,7 +100,7 @@ # # add and remove object mixin for classes via object mixin add # -Test case class+mixin-add { +nx::test case class+mixin-add { ? {C object mixin add M} ::M ? {C info precedence} "::M ::nx::Class ::nx::Object" ? {C info object mixin classes} "::M" @@ -126,13 +124,13 @@ -Test case mixin-add { +nx::test case mixin-add { - Class create M1 { + nx::Class create M1 { :method mfoo {} {puts [current method]} } - Class create M11 - Class create C1 + nx::Class create M11 + nx::Class create C1 ? {C1 info lookup method mixin} "::nsf::classes::nx::Class::mixin" C1 object mixin M1 @@ -144,14 +142,14 @@ Object create o -object-mixin M1 ? {o info precedence} "::M1 ::nx::Object" - Class create O + nx::Class create O O object mixin M1 ? {O info precedence} "::M1 ::nx::Class ::nx::Object" - Class create O -object-mixin M1 + nx::Class create O -object-mixin M1 ? {O info precedence} "::M1 ::nx::Class ::nx::Object" } -Test case filter-relation { +nx::test case filter-relation { nx::Class create CC { :public method filterA args {next} :public method filterB args {next} @@ -207,9 +205,9 @@ } -Test parameter count 3 -Test case "filter-and-creation" { - Class create Foo { +nx::test configure -count 3 +nx::test case "filter-and-creation" { + nx::Class create Foo { :method myfilter {args} { set i [::incr ::count] set s [self] @@ -265,16 +263,16 @@ } -Test parameter count 1 +nx::test configure -count 1 # # Test the next-path with just intrinsic classes in cases where a # method handle is used for method dispatch # -nx::Test case intrinsic+method-handles { - Class create A {:public method foo {} {return "A [next]"}} - Class create B -superclass A {:public method foo {} {return "B [next]"}} - Class create C -superclass B {:public method foo {} {return "C [next]"}} +nx::test case intrinsic+method-handles { + nx::Class create A {:public method foo {} {return "A [next]"}} + nx::Class create B -superclass A {:public method foo {} {return "B [next]"}} + nx::Class create C -superclass B {:public method foo {} {return "C [next]"}} C create c1 ? {c1 foo} "C B A " @@ -306,15 +304,15 @@ # method handle is used for method dispatch # -nx::Test case mixins+method-handles { +nx::test case mixins+method-handles { # # Just mixin classes # - Class create A {:public method foo {} {return "A [next]"}} - Class create B {:public method foo {} {return "B [next]"}} - Class create C {:public method foo {} {return "C [next]"}} + nx::Class create A {:public method foo {} {return "A [next]"}} + nx::Class create B {:public method foo {} {return "B [next]"}} + nx::Class create C {:public method foo {} {return "C [next]"}} - Class create X -mixin {C B A} + nx::Class create X -mixin {C B A} X create c1 ? {c1 foo} "C B A " ? {c1 [C info method definitionhandle foo]} "C B A " @@ -325,8 +323,8 @@ # Intrinsic classes and mixin classes # - Class create Y {:public method foo {} {return "Y [next]"}} - Class create Z -superclass Y {:public method foo {} {return "Z [next]"}} + nx::Class create Y {:public method foo {} {return "Y [next]"}} + nx::Class create Z -superclass Y {:public method foo {} {return "Z [next]"}} Z create c1 -object-mixin {C B A} ? {c1 foo} "C B A Z Y " @@ -360,15 +358,15 @@ # method handle is used for method dispatch # -nx::Test case mixins+method-handles+intrinsic { +nx::test case mixins+method-handles+intrinsic { # # Just mixin classes # - Class create A {:public method foo {} {return "A [next]"}} - Class create B {:public method foo {} {return "B [next]"}} - Class create C {:public method foo {} {return "C [next]"}} + nx::Class create A {:public method foo {} {return "A [next]"}} + nx::Class create B {:public method foo {} {return "B [next]"}} + nx::Class create C {:public method foo {} {return "C [next]"}} - Class create X -mixin {C B A} { + nx::Class create X -mixin {C B A} { :public method foo {} {return "X [next]"} } X create c1 @@ -380,8 +378,8 @@ # Intrinsic classes and mixin classes # - Class create Y {:public method foo {} {return "Y [next]"}} - Class create Z -superclass Y {:public method foo {} {return "Z [next]"}} + nx::Class create Y {:public method foo {} {return "Y [next]"}} + nx::Class create Z -superclass Y {:public method foo {} {return "Z [next]"}} Z create c1 -object-mixin {C B A} ? {c1 foo} "C B A Z Y " Index: tests/interp.test =================================================================== diff -u -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/interp.test (.../interp.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ tests/interp.test (.../interp.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -5,7 +5,7 @@ puts ">>> traceStderr HA! $args" } -nx::Test case hidden-cmds { +nx::test case hidden-cmds { global i # @@ -160,7 +160,7 @@ # # Explicit destruction # -nx::Test case hidden-cmds+explicit-delete { +nx::test case hidden-cmds+explicit-delete { global i set i [interp create] @@ -198,7 +198,7 @@ # # hide and re-expose # -nx::Test case hide-and-re-expose { +nx::test case hide-and-re-expose { global i set i [interp create] @@ -251,7 +251,7 @@ # # hide/re-expose with "command renaming" # -nx::Test case command-renaming { +nx::test case command-renaming { global i set i [interp create] @@ -309,7 +309,7 @@ # # Rename namespaced object to global one and hide ... # -nx::Test case namespaced-object { +nx::test case namespaced-object { global i set i [interp create] @@ -354,7 +354,7 @@ # Deletion order # -nx::Test case deletion-order { +nx::test case deletion-order { global i set i [interp create] @@ -391,7 +391,7 @@ # # Some stumbling blocks in destructors: [error] in app-level destroy # -nx::Test case error-in-destroy-1 { +nx::test case error-in-destroy-1 { global i set i [interp create] @@ -427,7 +427,7 @@ # Some stumbling blocks in destructors: [interp hide] in app-level # destroy # -nx::Test case error-in-destroy-2 { +nx::test case error-in-destroy-2 { global i set i [interp create] @@ -471,7 +471,7 @@ # # Some stumbling blocks in destructors: [interp hide] in app-level destroy # -nx::Test case error-in-destroy-3 { +nx::test case error-in-destroy-3 { global i set i [interp create] @@ -504,7 +504,7 @@ # see NsfProcAliasMethod(): # Tcl_Command_cmdEpoch(tcd->aliasedCmd) # -nx::Test case hidden-procs-as-aliases { +nx::test case hidden-procs-as-aliases { # # 1) hide alias proc targets # @@ -581,7 +581,7 @@ } -nx::Test case hidden-objects-as-aliases { +nx::test case hidden-objects-as-aliases { # # 2) hide alias object targets # @@ -647,7 +647,7 @@ # MixinSearchProc() # -nx::Test case hidden-mixins-procsearch { +nx::test case hidden-mixins-procsearch { global i set i [interp create] $i eval { @@ -703,7 +703,7 @@ # MixinComputeOrderFullList() & friends (due to # CmdListRemoveDeleted() # -nx::Test case hidden-mixins-mixinlists { +nx::test case hidden-mixins-mixinlists { global i set i [interp create] $i eval { Index: tests/introspection.test =================================================================== diff -u -rb2ab5886fc3278e549bb2772dfce921fbd06a9e9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/introspection.test (.../introspection.test) (revision b2ab5886fc3278e549bb2772dfce921fbd06a9e9) +++ tests/introspection.test (.../introspection.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -5,7 +5,7 @@ # [::nsf::current calledclass] # -nx::Test case current-calledclass { +nx::test case current-calledclass { Object create o { :public method foo {} { return [current calledclass] @@ -51,7 +51,7 @@ # # [::nsf::current calledclass] # -nx::Test case current-calledmethod { +nx::test case current-calledmethod { set body { return [list [current nextmethod] {*}[next]] } Index: tests/method-parameter.test =================================================================== diff -u -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/method-parameter.test (.../method-parameter.test) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) +++ tests/method-parameter.test (.../method-parameter.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -2,7 +2,7 @@ package require nx package require nx::test -nx::Test case method-params-0 { +nx::test case method-params-0 { nsf::proc p0 {} {return 1} nsf::proc p1 {-x} {return [list [info exists x]]} @@ -38,7 +38,7 @@ -nx::Test case noleadingdash { +nx::test case noleadingdash { nsf::proc p2a {-x args} {return [list [info exists x] $args]} nsf::proc p2b {-x args:noleadingdash} {return [list [info exists x] $args]} @@ -61,7 +61,7 @@ should be "p3a /a/ ?-x /value/? ?-y /value/? /b/ ?-z /value/?"} } -nx::Test case unknown-handler { +nx::test case unknown-handler { Class create C { :public method p1 {-x} {return [list [info exists x]]} Index: tests/method-require.test =================================================================== diff -u -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/method-require.test (.../method-require.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ tests/method-require.test (.../method-require.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -2,8 +2,8 @@ package require nx package require nx::test -nx::Test parameter count 10 -nx::Test case method-require { +nx::test configure -count 10 +nx::test case method-require { # # A few method-provides @@ -93,7 +93,7 @@ } -nx::Test case parent-require { +nx::test case parent-require { ::nx::Class public object method __unknown {name} { #puts stderr "***** __unknown called with <$name>" @@ -122,7 +122,7 @@ # Test what happens if a class-specific method is registered and # called on an object. # -nx::Test case method-require-scope { +nx::test case method-require-scope { nx::Object create o ::nsf::method::require o __alloc Index: tests/methods.test =================================================================== diff -u -r925485d2ec3b626277037d5fd3154172cc989f7a -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/methods.test (.../methods.test) (revision 925485d2ec3b626277037d5fd3154172cc989f7a) +++ tests/methods.test (.../methods.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -4,7 +4,7 @@ ::nx::configure defaultMethodCallProtection false -nx::Test parameter count 10 +nx::test configure -count 10 nx::Class create C { # methods @@ -74,23 +74,23 @@ # create a fresh object (different from c1) C create c2 # test scripted class level methods -nx::Test case scripted-class-level-methods { +nx::test case scripted-class-level-methods { ? {c2 plain_method} "plain_method" ? {c2 public_method} "public_method" ? {catch {c2 protected_method}} 1 ? {::nsf::dispatch c2 protected_method} "protected_method" } # class level forwards -nx::Test case class-level-forwards { +nx::test case class-level-forwards { ? {c2 plain_forward} "plain_method" ? {c2 public_forward} "public_method" ? {catch {c2 protected_forward}} 1 ? {::nsf::dispatch c2 protected_forward} "protected_method" } # class level setter -nx::Test case class-level-setter { +nx::test case class-level-setter { ? {c2 plain_setter 1} {::c2: unable to dispatch method 'plain_setter'} #? {c2 plain_setter 1} 1 ? {c2 public_setter 2} "2" @@ -99,7 +99,7 @@ } # class level alias .... -nx::Test case class-level-alias { +nx::test case class-level-alias { ? {c2 plain_alias} "plain_alias" ? {c2 public_alias} "public_alias" ? {catch {c2 protected_alias}} 1 @@ -109,23 +109,23 @@ ########### # scripted class level methods -nx::Test case scripted-class-object-level { +nx::test case scripted-class-object-level { ? {C plain_object_method} "plain_object_method" ? {C public_object_method} "public_object_method" ? {catch {C protected_object_method}} 1 ? {::nsf::dispatch C protected_object_method} "protected_object_method" } # class level forwards -nx::Test case class-object-level-forwards { +nx::test case class-object-level-forwards { ? {C plain_object_forward} "plain_object_method" ? {C public_object_forward} "public_object_method" ? {catch {C protected_object_forward}} 1 ? {::nsf::dispatch C protected_object_forward} "protected_object_method" } # class level setter -nx::Test case class-object-level-setter { +nx::test case class-object-level-setter { ? {C plain_object_setter 1} {method 'plain_object_setter' unknown for ::C; consider '::C create plain_object_setter 1' instead of '::C plain_object_setter 1'} #? {C plain_object_setter 1} "1" ? {C public_object_setter 2} "2" @@ -134,7 +134,7 @@ } # class level alias .... -nx::Test case class-object-level-alias { +nx::test case class-object-level-alias { ? {C plain_object_alias} "plain_object_alias" ? {C public_object_alias} "public_object_alias" ? {catch {C protected_object_alias}} 1 @@ -144,23 +144,23 @@ ########### # scripted object level methods -nx::Test case scripted-object-level-methods { +nx::test case scripted-object-level-methods { ? {c1 plain_object_method} "plain_object_method" ? {c1 public_object_method} "public_object_method" ? {catch {c1 protected_object_method}} 1 ? {::nsf::dispatch c1 protected_object_method} "protected_object_method" } # object level forwards -nx::Test case object-level-forwards { +nx::test case object-level-forwards { ? {c1 plain_object_forward} "plain_object_method" ? {c1 public_object_forward} "public_object_method" ? {catch {c1 protected_object_forward}} 1 ? {::nsf::dispatch c1 protected_object_forward} "protected_object_method" } # object level setter -nx::Test case object-level-setter { +nx::test case object-level-setter { ? {c1 plain_object_setter 1} {::c1: unable to dispatch method 'plain_object_setter'} #? {c1 plain_object_setter 1} "1" ? {c1 public_object_setter 2} "2" @@ -169,7 +169,7 @@ } # object level alias .... -nx::Test case object-level-alias { +nx::test case object-level-alias { ? {c1 plain_object_alias} "plain_object_alias" ? {c1 public_object_alias} "public_object_alias" ? {catch {c1 protected_object_alias}} 1 @@ -188,7 +188,7 @@ C destroy -nx::Test case colondispatch { +nx::test case colondispatch { nx::Object create ::o { #:public object method foo args {;} :public object method bar args {;} @@ -199,7 +199,7 @@ ? {o eval :foo} "::o: unable to dispatch method 'foo'" } -nx::Test case mixinguards { +nx::test case mixinguards { # define a Class C and mixin class M nx::Class create C nx::Class create M @@ -219,7 +219,7 @@ ? {C info object mixin guard M} "" } -nx::Test case mixin-via-objectparam { +nx::test case mixin-via-objectparam { # add an object and class mixin via object-parameter and via slots nx::Class create M1; nx::Class create M2; nx::Class create M3; nx::Class create M4 nx::Class create C -mixin M1 -object-mixin M2 { @@ -237,7 +237,7 @@ } # testing next via nonpos-args -nx::Test case next-from-nonpos-args { +nx::test case next-from-nonpos-args { nx::Object create o { :object method bar {-y:required -x:required} { @@ -260,7 +260,7 @@ # # test method property with protected/public # -nx::Test case property-method { +nx::test case property-method { nx::Class create C { set x [:property -accessor public a] @@ -310,7 +310,7 @@ ? {o d} "::o: unable to dispatch method 'd'" } -nx::Test case subcmd { +nx::test case subcmd { nx::Class create Foo { @@ -341,7 +341,7 @@ } package req nx::serializer -nx::Test case class-object-property { +nx::test case class-object-property { nx::Class create C { :object property -accessor public x :property -accessor public a:int @@ -379,9 +379,9 @@ # # Test method deletion # -nx::Test parameter count 1 +nx::test configure -count 1 -nx::Test case methoddelete { +nx::test case methoddelete { nx::Class create C { :public method foo {x} {return $x} :public object method bar {x} {return $x} @@ -400,9 +400,9 @@ # # Test error message of method modifier # -nx::Test parameter count 1 +nx::test configure -count 1 -nx::Test case errormessage { +nx::test case errormessage { nx::Class create C ? {C public method foo {x} {return $x}} "::nsf::classes::C::foo" ? {C public Object method bar {x} {return $x}} \ @@ -419,7 +419,7 @@ # # test dispatch without object # -nx::Test case dispatch-without-object { +nx::test case dispatch-without-object { nx::Object create o { # property defines a setter, we need a current object @@ -452,7 +452,7 @@ # b) ensemble methods on level 1 # c) ensemble methods on level 2 # -nx::Test case scopes { +nx::test case scopes { nx::Object create o1 { :public object method foo {} {return [namespace current]-[namespace which info]} :public object method "info foo" {} {return [namespace current]-[namespace which info]} @@ -482,7 +482,7 @@ # b) ensemble methods on level 1 # c) ensemble methods on level 2 # -nx::Test case namespaced-scopes { +nx::test case namespaced-scopes { namespace eval ::ns { nx::Object create o1 { @@ -515,7 +515,7 @@ # b) ensemble methods on level 1 # c) ensemble methods on level 2 # -nx::Test case nested-scopes { +nx::test case nested-scopes { nx::Object create o nx::Object create o::o1 { :public object method foo {} {return [namespace current]-[namespace which info]} @@ -547,7 +547,7 @@ # b) test simple methods # c) test ensemble methods # -nx::Test case delete-per-object { +nx::test case delete-per-object { nx::Object create o1 { :object property -accessor public a1 :object property -accessor public a2 @@ -593,7 +593,7 @@ # b) test simple methods # c) test ensemble methods # -nx::Test case delete-per-object-on-class { +nx::test case delete-per-object-on-class { nx::Class create C { :object property -accessor public a1 :public object method foo {} {return [namespace current]-[namespace which info]} @@ -632,7 +632,7 @@ # b) test simple methods # c) test ensemble methods # -nx::Test case delete-class-level-method { +nx::test case delete-class-level-method { nx::Class create C { :property -accessor public a1 :public method foo {} {return [namespace current]-[namespace which info]} @@ -664,7 +664,7 @@ # simple unknown tests; # ensemble unknown tests are in submethods.test # -nx::Test case test-simple-unknown { +nx::test case test-simple-unknown { # # calling unknown with a plain "method" without arguments @@ -696,8 +696,8 @@ # simple speed tests # ensemble unknown tests are in submethods.test # -nx::Test parameter count 1000 -nx::Test case speed-dispatch { +nx::test configure -count 1000 +nx::test case speed-dispatch { # # define various forms of simple dispatches @@ -729,8 +729,8 @@ #? {o bar09} foo "my -system info" } -nx::Test parameter count 1 -nx::Test case fq-obj-dispatch { +nx::test configure -count 1 +nx::test case fq-obj-dispatch { # # Capture the (current) dispatcher rules for fully-qualified # selectors which resolve to existing objects. @@ -847,7 +847,7 @@ # # object copy # -nx::Test case object-copy { +nx::test case object-copy { nsf::method::provide set {::nsf::method::alias set -frame object ::set} nx::Object create o { @@ -879,7 +879,7 @@ # # class copy # -nx::Test case class-copy { +nx::test case class-copy { nsf::method::provide set {::nsf::method::alias set -frame object ::set} nx::Class create C { @@ -920,7 +920,7 @@ # # class copy with class object methods # -nx::Test case object+class-copy { +nx::test case object+class-copy { nsf::method::provide set {::nsf::method::alias set -frame object ::set} nsf::method::provide exists {::nsf::method::alias exists ::nsf::methods::object::exists} @@ -975,11 +975,11 @@ -nx::Test parameter count 10 +nx::test configure -count 10 # # class copy with class object methods # -nx::Test case object+class+property-copy { +nx::test case object+class+property-copy { nsf::method::provide set {::nsf::method::alias set -frame object ::set} nsf::method::provide exists {::nsf::method::alias exists ::nsf::methods::object::exists} @@ -1055,7 +1055,7 @@ } -nx::Test case xotcl-COPY { +nx::test case xotcl-COPY { package req XOTcl xotcl::Class create C C proc foo {} {return foo} Index: tests/mixinof.test =================================================================== diff -u -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/mixinof.test (.../mixinof.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ tests/mixinof.test (.../mixinof.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -3,14 +3,13 @@ package require nx package require nx::test -namespace import ::nx::* -Test parameter count 100 +nx::test configure -count 100 ########################################### # testing simple per object mixins ########################################### -Class create A -Object create o -object-mixin A +nx::Class create A +nx::Object create o -object-mixin A ? {o object mixin} ::A ? {o info object mixin classes} ::A ? {A info mixinof} ::o @@ -24,14 +23,14 @@ # testing transitive per object mixins ########################################### -Class create B -Class create C -superclass B +nx::Class create B +nx::Class create C -superclass B -Class create M +nx::Class create M B mixin M -Object create o -object-mixin C -Object create o1 -object-mixin B +nx::Object create o -object-mixin C +nx::Object create o1 -object-mixin B ? {C info mixinof} ::o ? {lsort [B info mixinof -closure]} "::o ::o1" ? {lsort [B info mixinof -closure ::o1]} "::o1" @@ -50,14 +49,14 @@ ########################################### # testing per object mixins with redefinition ########################################### -Class create M {:method foo args {puts x;next}} -Object create o -object-mixin M +nx::Class create M {:method foo args {puts x;next}} +nx::Object create o -object-mixin M ? {o info object mixin classes} ::M ? {o info precedence} "::M ::nx::Object" ? {o info lookup method foo} "::nsf::classes::M::foo" -Class create M {:method foo args next} +nx::Class create M {:method foo args next} ? {o info object mixin classes} ::M ? {o info precedence} "::M ::nx::Object" ? {o info lookup method foo} "::nsf::classes::M::foo" @@ -72,10 +71,10 @@ ########################################### # testing simple per class mixins ########################################### -Test case pcm -Class create A -Class create B -mixin A -Class create C -superclass B +nx::test case pcm +nx::Class create A +nx::Class create B -mixin A +nx::Class create C -superclass B C create c1 ? {B mixin} ::A @@ -94,13 +93,13 @@ ########################################### # testing simple per class mixins with guards ########################################### -Test case pcm2 -Class create M1 -Class create M2 -Class create X -Class create A -mixin {M1 M2 X} +nx::test case pcm2 +nx::Class create M1 +nx::Class create M2 +nx::Class create X +nx::Class create A -mixin {M1 M2 X} A mixin guard M1 "test" -Class create B -superclass A +nx::Class create B -superclass A ? {A info mixin classes M2} ::M2 ? {A info mixin classes M*} "::M1 ::M2" ? {A info mixin classes -guards} "{::M1 -guard test} ::M2 ::X" @@ -120,11 +119,11 @@ ########################################### # testing transitive per class mixins ########################################### -Test case trans-pcm1 -Class create A -Class create B -mixin A -Class create C -superclass B -A mixin [Class create M] +nx::test case trans-pcm1 +nx::Class create A +nx::Class create B -mixin A +nx::Class create C -superclass B +A mixin [nx::Class create M] A create a1 B create b1 @@ -162,12 +161,12 @@ ########################################### # testing transitive per class mixins with subclasses ########################################### -Test case trans-pcm2 -Class create X -Class create D -Class create C -superclass D -Class create A -mixin C -Class create B -superclass A +nx::test case trans-pcm2 +nx::Class create X +nx::Class create D +nx::Class create C -superclass D +nx::Class create A -mixin C +nx::Class create B -superclass A B create b1 ? {C info mixinof -scope class -closure} "::A ::B" @@ -190,10 +189,10 @@ ########################################### # testing transitive per class mixins with subclasses ########################################### -Test case trans-pcm3 -Class create A3 -superclass [Class create A2 -superclass [Class create A1]] -Class create B3 -superclass [Class create B2 -superclass [Class create B1 -superclass [Class create B0]]] -Class create C3 -superclass [Class create C2 -superclass [Class create C1]] +nx::test case trans-pcm3 +nx::Class create A3 -superclass [nx::Class create A2 -superclass [nx::Class create A1]] +nx::Class create B3 -superclass [nx::Class create B2 -superclass [nx::Class create B1 -superclass [nx::Class create B0]]] +nx::Class create C3 -superclass [nx::Class create C2 -superclass [nx::Class create C1]] A2 mixin B2 B1 mixin C2 @@ -216,10 +215,10 @@ ########################################### # testing transitive per class mixins with destroy ########################################### -Test case pcm-trans-destroy-A -Class create A -mixin [Class create M] -Class create B -mixin A -Class create C -superclass B +nx::test case pcm-trans-destroy-A +nx::Class create A -mixin [nx::Class create M] +nx::Class create B -mixin A +nx::Class create C -superclass B A create a1 B create b1 @@ -250,10 +249,10 @@ ########################################### # testing transitive per class mixins with destroy ########################################### -Test case pcm-trans-destroy-B -Class create A -mixin [Class create M] -Class create B -mixin A -Class create C -superclass B +nx::test case pcm-trans-destroy-B +nx::Class create A -mixin [nx::Class create M] +nx::Class create B -mixin A +nx::Class create C -superclass B A create a1 B create b1 @@ -282,10 +281,10 @@ ########################################### # testing simple per class mixins with redefinition ########################################### -Test case pcm-redefine { - Class create A - Class create B -mixin A - Class create C -superclass B +nx::test case pcm-redefine { + nx::Class create A + nx::Class create B -mixin A + nx::Class create C -superclass B C create c1 ? {B mixin} ::A @@ -297,7 +296,7 @@ ? {B info heritage} "::A ::nx::Object" ? {C info heritage} "::A ::B ::nx::Object" - Class create B -mixin A + nx::Class create B -mixin A ? {B info superclass -closure} "::nx::Object" ? {C info superclass -closure} "::nx::Object" @@ -318,11 +317,11 @@ # testing simple per class mixins with # redefinition and softrecreate ########################################### -Test case pcm-redefine-soft { +nx::test case pcm-redefine-soft { ::nsf::configure softrecreate true - Class create A - Class create B -mixin A - Class create C -superclass B + nx::Class create A + nx::Class create B -mixin A + nx::Class create C -superclass B C create c1 ? {B mixin} ::A @@ -334,7 +333,7 @@ ? {B info heritage} "::A ::nx::Object" ? {C info heritage} "::A ::B ::nx::Object" - Class create B -mixin A + nx::Class create B -mixin A ? {B info superclass -closure} "::nx::Object" ? {C info superclass -closure} "::B ::nx::Object" @@ -354,11 +353,11 @@ # test of recreate with same superclass, # with softrecreate off ########################################### -Test case precedence +nx::test case precedence ::nsf::configure softrecreate false -Class create O -Class create A -superclass O -Class create B -superclass A +nx::Class create O +nx::Class create A -superclass O +nx::Class create B -superclass A B create b1 A create a1 O create o1 @@ -371,7 +370,7 @@ ? {a1 info precedence} "::A ::O ::nx::Object" ? {b1 info precedence} "::B ::A ::O ::nx::Object" # we recreate the class new, with the same superclass -Class create A -superclass O +nx::Class create A -superclass O ? {A info superclass} "::O" ? {B info heritage} "::nx::Object" ? {list [A info subclass] [B info subclass] [O info subclass]} "{} {} ::A" @@ -386,11 +385,11 @@ # test of recreate with different superclass # with softrecreate on ########################################### -Test case alternate-precedence +nx::test case alternate-precedence ::nsf::configure softrecreate false -Class create O -Class create A -superclass O -Class create B -superclass A +nx::Class create O +nx::Class create A -superclass O +nx::Class create B -superclass A B create b1 A create a1 O create o1 @@ -403,7 +402,7 @@ ? {a1 info precedence} "::A ::O ::nx::Object" ? {b1 info precedence} "::B ::A ::O ::nx::Object" # we recreate the class new, with a different superclass -Class create A +nx::Class create A ? {A info superclass} "::nx::Object" ? {B info heritage} "::nx::Object" ? {list [A info subclass] [B info subclass] [O info subclass]} "{} {} {}" @@ -419,11 +418,11 @@ # test of recreate with same superclass, # with softrecreate on ########################################### -Test case recreate-precedence +nx::test case recreate-precedence ::nsf::configure softrecreate true -Class create O -Class create A -superclass O -Class create B -superclass A +nx::Class create O +nx::Class create A -superclass O +nx::Class create B -superclass A B create b1 A create a1 O create o1 @@ -436,7 +435,7 @@ ? {a1 info precedence} "::A ::O ::nx::Object" ? {b1 info precedence} "::B ::A ::O ::nx::Object" # we recreate the class new, with the same superclass -Class create A -superclass O +nx::Class create A -superclass O ? {A info superclass} "::O" ? {B info heritage} "::A ::O ::nx::Object" ? {list [A info subclass] [B info subclass] [O info subclass]} "::B {} ::A" @@ -451,11 +450,11 @@ # test of recreate with different superclass # with softrecreate on ########################################### -Test case recreate-alternate-precedence +nx::test case recreate-alternate-precedence ::nsf::configure softrecreate true -Class create O -Class create A -superclass O -Class create B -superclass A +nx::Class create O +nx::Class create A -superclass O +nx::Class create B -superclass A B create b1 A create a1 O create o1 @@ -467,7 +466,7 @@ ? {a1 info precedence} "::A ::O ::nx::Object" ? {b1 info precedence} "::B ::A ::O ::nx::Object" # we recreate the class new, with a different superclass -Class create A +nx::Class create A ? {A info superclass} "::nx::Object" ? {B info heritage} "::A ::nx::Object" ? {B info heritage} "::A ::nx::Object" @@ -479,21 +478,16 @@ ? {b1 info precedence} "::B ::A ::nx::Object" foreach o {A O B a1 b1 o1} {$o destroy} -#foreach o [::nx::test::Test info instances] {$o destroy} -#::nx::test::Test destroy -#puts [lsort [::nx::Object allinstances]] - -namespace import -force ::nx::* ########################################### # testing simple per object mixins ########################################### -Test case nx-mixinof { - Class create M - Class create A - Class create C +nx::test case nx-mixinof { + nx::Class create M + nx::Class create A + nx::Class create C C create c1 -object-mixin A C create c2 - Class create C2 -mixin A + nx::Class create C2 -mixin A C2 create c22 ? {c1 object mixin} ::A Index: tests/parameters.test =================================================================== diff -u -rdd76d711addf35ee16af13d4d4a6774a8ebd1795 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/parameters.test (.../parameters.test) (revision dd76d711addf35ee16af13d4d4a6774a8ebd1795) +++ tests/parameters.test (.../parameters.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -4,7 +4,7 @@ #::nx::configure defaultMethodCallProtection false -nx::Test case dummy { +nx::test case dummy { ? {::namespace current} :: set o [Object create o] @@ -15,7 +15,7 @@ # # simple test case for parameter passing # -nx::Test case syntax { +nx::test case syntax { ::nx::Class create C ? {::nsf::method::alias C} \ @@ -33,8 +33,8 @@ ####################################################### # parametercheck ####################################################### -nx::Test parameter count 1000 -nx::Test case parametercheck { +nx::test configure -count 1000 +nx::test case parametercheck { nx::Object create o1 nx::Class create C { @@ -120,8 +120,8 @@ ? {::nsf::is -complain class o1} {expected class but got "o1"} ? {::nsf::is class o1} 0 - ? {::nsf::is -complain class nx::Test} 1 - ? {::nsf::is -complain object,1..* [list o1 nx::Test]} 1 + ? {::nsf::is -complain class nx::test} 1 + ? {::nsf::is -complain object,1..* [list o1 nx::test]} 1 ? {::nsf::is -complain integer,1..* [list 1 2 3]} 1 ? {::nsf::is -complain integer,1..* [list 1 2 3 a]} \ @@ -146,8 +146,8 @@ ? {::nsf::is -complain {i:integer 1} 2} {invalid value constraints "i:integer 1"} } -nx::Test parameter count 10 -nx::Test case multiple-method-checkers { +nx::test configure -count 10 +nx::test case multiple-method-checkers { nx::Object create o { :public object method foo {} { ::nsf::is metaclass ::XYZ @@ -178,8 +178,8 @@ ####################################################### # param manager ####################################################### -nx::Test parameter count 10000 -nx::Test case param-manager { +nx::test configure -count 10000 +nx::test case param-manager { nx::Object create ::paramManager { :object method type=sex {name value} { @@ -264,8 +264,8 @@ ####################################################### # objectparameter ####################################################### -nx::Test parameter count 10 -nx::Test case objectparameter { +nx::test configure -count 10 +nx::test case objectparameter { nx::Class create C { :property a @@ -285,7 +285,7 @@ ####################################################### # reclass to nx::Object, no need to do anything on caching ####################################################### -nx::Test case reclass { +nx::test case reclass { nx::Class create C { :property a @@ -313,7 +313,7 @@ ####################################################### # Add mixin ####################################################### -nx::Test case objparam-mixins { +nx::test case objparam-mixins { nx::Class create C { :property a @@ -365,7 +365,7 @@ # test passed arguments ####################################################### -nx::Test case passed-arguments { +nx::test case passed-arguments { nx::Class create C { :property a @@ -436,7 +436,7 @@ ####################################################### # non required positional arguments ####################################################### -nx::Test case non-reg-args { +nx::test case non-reg-args { nx::Class create D D create d1 @@ -458,7 +458,7 @@ ####################################################### # multivalued arguments ####################################################### -nx::Test case multivalued { +nx::test case multivalued { nx::Class create D D create d1 @@ -506,7 +506,7 @@ ####################################################### # subst default tests ####################################################### -nx::Test case subst-default { +nx::test case subst-default { nx::Class create D { :property {c 1} @@ -637,7 +637,7 @@ ####################################################### # user defined parameter value checkers ####################################################### -nx::Test case user-value-checker { +nx::test case user-value-checker { nx::Class create D {:property d} D create d1 @@ -782,7 +782,7 @@ ####################################################### # testing object types in method parameters ####################################################### -nx::Test case mp-object-types { +nx::test case mp-object-types { nx::Class create C nx::Class create D -superclass C {:property d} @@ -857,7 +857,7 @@ ####################################################### # substdefault ####################################################### -nx::Test case substdefault { +nx::test case substdefault { nx::Class create S { :property {x 1} @@ -916,7 +916,7 @@ ####################################################### # testing substdefault for object parameters ####################################################### -nx::Test case substdefault-objparam { +nx::test case substdefault-objparam { nx::Class create Bar { @@ -943,7 +943,7 @@ # # Test call of configure within constructor # -nx::Test case parameter-alias-default { +nx::test case parameter-alias-default { ::nsf::method::require nx::Object __configure nx::Class create C { @@ -967,7 +967,7 @@ ####################################################### # testing object types in object parameters ####################################################### -nx::Test case op-object-types { +nx::test case op-object-types { nx::Class create C nx::Class create D -superclass C {:property d} @@ -1078,7 +1078,7 @@ ####################################################### # application specific multivalued converter ####################################################### -nx::Test case multivalued-app-converter { +nx::test case multivalued-app-converter { ::nx::methodParameterSlot public object method type=sex {name value args} { #puts stderr "[current] slot specific converter" @@ -1115,7 +1115,7 @@ ####################################################### # application specific multivalued converter ####################################################### -nx::Test case shadowing-app-converter { +nx::test case shadowing-app-converter { nx::Object create mySlot { :public object method type=integer {name value arg:optional} { @@ -1136,7 +1136,7 @@ ####################################################### # allow empty values ####################################################### -nx::Test case allow-empty { +nx::test case allow-empty { nx::Object create o1 nx::Object create o2 @@ -1164,7 +1164,7 @@ ####################################################### # slot specific converter ####################################################### -nx::Test case slot-specfic-converter { +nx::test case slot-specfic-converter { nx::Class create Person { :property -accessor public sex { @@ -1192,7 +1192,7 @@ ####################################################### # test for setters with parameters ####################################################### -nx::Test case setters { +nx::test case setters { nx::Object create o nx::Class create C @@ -1234,8 +1234,8 @@ ####################################################### # test for slot-optimizer ####################################################### -nx::Test parameter count 1000 -nx::Test case slot-optimizer { +nx::test configure -count 1000 +nx::test case slot-optimizer { nx::Class create C { :property -accessor public a @@ -1249,8 +1249,8 @@ ? {c1 c 1} 1 } -nx::Test parameter count 10 -nx::Test case slot-nosetter { +nx::test configure -count 10 +nx::test case slot-nosetter { nx::Class create C { :property -accessor public a :property -accessor none b:integer @@ -1264,8 +1264,8 @@ ? {c1 c 102} {::c1: unable to dispatch method 'c'} } -nx::Test parameter count 1000 -nx::Test case check-arguments { +nx::test configure -count 1000 +nx::test case check-arguments { nx::Class create Foo { :public method noarg {} {return ""} @@ -1298,7 +1298,7 @@ ? {f1 metaclassarg ::Foo} {expected metaclass but got "::Foo" for parameter "x"} } -nx::Test case slot-traces { +nx::test case slot-traces { ::nx::Object create o { :object property -accessor public a {set :defaultcmd { set _ 4 } } :object property -accessor public b {set :valuecmd { set _ 44 } } @@ -1341,7 +1341,7 @@ ? {d1 c 5} 999 } -nx::Test case slot-trace-interaction { +nx::test case slot-trace-interaction { # # 1) Verify the controlled interactions between trace types # @@ -1475,7 +1475,7 @@ } ::nsf::configure checkarguments off -nx::Test case check-arguments-nocheck { +nx::test case check-arguments-nocheck { nx::Class create Foo { :public method noarg {} {return ""} @@ -1508,9 +1508,9 @@ ? {f1 metaclassarg ::Foo} ::Foo } -nx::Test parameter count 100 +nx::test configure -count 100 -nx::Test case checktype { +nx::test case checktype { nx::Object create o { :public object method f01 {} {::nsf::dispatch o ::nsf::methods::object::info::hastype ::nx::Object} :public object method f02 {} {::nsf::dispatch o ::nsf::methods::object::info::hastype nx::Object} @@ -1574,7 +1574,7 @@ ? {c1 f32} 1 } -nx::Test case check-arguments { +nx::test case check-arguments { nx::Class create Foo { :method noarg {} {return ""} @@ -1605,7 +1605,7 @@ # Check whether resetting via method "configure" changes values in the # initialzed object state. # -nx::Test case dont-reset-to-defaults { +nx::test case dont-reset-to-defaults { nx::Class create C { :property -accessor public {a 1} :create c1 @@ -1621,7 +1621,7 @@ ? {c1 a} 2 } -nx::Test case setter-under-coloncmd-and-interpvarresolver { +nx::test case setter-under-coloncmd-and-interpvarresolver { # There are (at least) three forms of object-namespace alignment in # NSF: # 1. Same-named namespace (::omon) predates a same-named object @@ -1667,7 +1667,7 @@ # test required configure parameter # -nx::Test case req-param { +nx::test case req-param { ::nx::Class create C { :property y:required :property x:required @@ -1727,10 +1727,10 @@ ::nsf::configure checkarguments on # -# nx::Test type any (or other typechecker) in combination with +# nx::test type any (or other typechecker) in combination with # substdefault via object parameter # -nx::Test case nsf-subdefault { +nx::test case nsf-subdefault { nx::Class create C { :property {n1 "[namespace tail [::nsf::self]]"} :property {n2:any "[namespace tail [::nsf::self]]"} @@ -1741,10 +1741,10 @@ } # -# nx::Test argument processing and namespace handling in nsf::procs +# nx::test argument processing and namespace handling in nsf::procs # -nx::Test case nsf-proc { +nx::test case nsf-proc { # # test inner namespace and handling of switches # @@ -1776,7 +1776,7 @@ nsf::proc -ad pass1 {-s:boolean} {foo -s=$s_p} } - nx::Test parameter count 1 + nx::test configure -count 1 ? {::nsf::mix} "::nsf-0-NULL" ? {::nsf::mix -per-object} "::nsf-1-NULL" ? {::nsf::mix -x true} "::nsf-0-true" @@ -1798,7 +1798,7 @@ return [namespace current]-[lsort [info vars]]-$html_p-$allow_complete_url_p } - nx::Test parameter count 1000 + nx::test configure -count 1000 ? {::ns1::pass1} "::ns1-0" ? {::ns1::pass1 -s} "::ns1-1" ? {::ns1::pass0} "::ns1-0" @@ -1809,8 +1809,8 @@ # Test argument processing and namespace handling in nsf::procs # -nx::Test case xotcl-list-notation { - nx::Test parameter count 1 +nx::test case xotcl-list-notation { + nx::test configure -count 1 package prefer latest package req XOTcl 2.0 @@ -1832,7 +1832,7 @@ # # Test parameter alias and parameter forwarder # -nx::Test case parameter-alias { +nx::test case parameter-alias { nx::Class create C { :property {x:alias} @@ -1854,7 +1854,7 @@ # # Test parameter alias and parameter forwarder with default value # -nx::Test case parameter-alias-default { +nx::test case parameter-alias-default { nx::Class create C { :property {x1:alias "hugo"} @@ -1881,7 +1881,7 @@ # Test interactions between per-object-mixins and objectparameters # (case without per-object property) # -nx::Test case parameter-object-mixin-dependency { +nx::test case parameter-object-mixin-dependency { nx::Class create C { :property a1 :create c1 @@ -1980,7 +1980,7 @@ # Test interactions between per-object-mixins and objectparameters # (case with per-object property) # -nx::Test case parameter-object-mixin-dependency-object-property { +nx::test case parameter-object-mixin-dependency-object-property { nx::Class create C { :property a1 :create c1 { @@ -2028,8 +2028,8 @@ # # Test integer, wideinteger and bignums # -nx::Test parameter count 1000 -nx::Test case bignums { +nx::test configure -count 1000 +nx::test case bignums { ::nx::Object create o { :public object method foo {x:int} { return $x } @@ -2109,7 +2109,7 @@ } -nx::Test case reconfigure-perobj-default { +nx::test case reconfigure-perobj-default { nx::Object create o ? {o eval {info exists :a}} 0 o object property {a oldvalue} @@ -2180,7 +2180,7 @@ # # test object level property and variable # -nx::Test case object-level-variable { +nx::test case object-level-variable { nx::Object create ::enterprise { @@ -2286,7 +2286,7 @@ # # test class level property and variable # -nx::Test case class-level-variable { +nx::test case class-level-variable { nx::Class create C { # define 2 class-level variables, one via variable, one via property @@ -2332,7 +2332,7 @@ # # test classes with single variable definitions, and illegal names # -nx::Test case single-variable { +nx::test case single-variable { ? {nx::Class create C { :variable v 1 :create c1 @@ -2347,7 +2347,7 @@ # # test deletion of class level property and variable # -nx::Test case delete-class-level-variable-and-property { +nx::test case delete-class-level-variable-and-property { nx::Class create C { # define 2 class-level variables, one via variable, one via property @@ -2387,7 +2387,7 @@ # # test deletion of class level property and variable # -nx::Test case delete-object-level-variable-and-property { +nx::test case delete-object-level-variable-and-property { nx::Object create o { # define 2 object-level variables, one via variable, one via property @@ -2417,7 +2417,7 @@ # Testing object parameters of type "switch" # -nx::Test case object-parameter-switch { +nx::test case object-parameter-switch { # Create a class with an property of type switch and an instance of # the class @@ -2477,7 +2477,7 @@ # Test slots with configparameter true/false, accessor true/false # against "slot definitions" and "info parameter" # -nx::Test case class-info-slots-types { +nx::test case class-info-slots-types { # # "/cls/ info slot ..." shows all slots, including variables # "/cls/ info parameter ..." shows the parameter available for object parameterization @@ -2516,7 +2516,7 @@ } -nx::Test case object-info-slots-types { +nx::test case object-info-slots-types { # # "/obj/ info slot ..." shows all slots, including variables # @@ -2557,7 +2557,7 @@ # # testing method properties # -nx::Test case properties { +nx::test case properties { # simple properties #nx::Class create Foo -properties {a {b 1}} @@ -2607,7 +2607,7 @@ # Note that the order, in which is the arguments are provided is not # significant for the evaluation order. # -nx::Test case side-effect-set-value { +nx::test case side-effect-set-value { nx::Class create C { :public object method setObjectParams {spec} { @@ -2628,8 +2628,8 @@ ? {[C new -second Y] eval {set :first}} Y "side-effect determines value" } -nx::Test case xotcl-configure-method { - nx::Test parameter count 1 +nx::test case xotcl-configure-method { + nx::test configure -count 1 package prefer latest package req XOTcl 2.0 @@ -2644,7 +2644,7 @@ # # Test forwarding to slot object, when assign is overloaded # -nx::Test case forward-to-assign { +nx::test case forward-to-assign { set ::slotcalls 0 nx::Class create Foo { :property -accessor public bar { @@ -2699,7 +2699,7 @@ # # Test forwarding to slot vs. accessor none # -nx::Test case forward-to-assign { +nx::test case forward-to-assign { set ::slotcalls 0 ? {nx::Class create Foo { @@ -2739,7 +2739,7 @@ # # Test slot initialize # -nx::Test case forward-to-incremental { +nx::test case forward-to-incremental { set ::slotcalls 0 ? {nx::Class create Foo { @@ -2762,7 +2762,7 @@ # property named "list" leads to a call to the container object # ::Test2::slot::list instead of the intended ::list. # -nx::Test case slot-container-name-interaction { +nx::test case slot-container-name-interaction { nx::Class create Test2 { :property -accessor public list { @@ -2781,7 +2781,7 @@ ? {t2 list this should call unknown} "unknown" } -nx::Test case object-level-defaults { +nx::test case object-level-defaults { # # In the scenario below, setCheckedInstVar is executed and performs # an ::nsf::is value check on the default value. However, given the @@ -2805,7 +2805,7 @@ ? {o a} 1 } -nx::Test case cmd-error-propagation { +nx::test case cmd-error-propagation { ? {nx::Object new { error "bow-wow" }} "bow-wow" Index: tests/plain-object-method.test =================================================================== diff -u -r7ba7b3c49ff542688258f50fba2fc8102f23a011 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/plain-object-method.test (.../plain-object-method.test) (revision 7ba7b3c49ff542688258f50fba2fc8102f23a011) +++ tests/plain-object-method.test (.../plain-object-method.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -1,7 +1,7 @@ # -*- Tcl -*- package require nx::test -nx::Test case plain-methods-0 { +nx::test case plain-methods-0 { nx::Class create M1 nx::Object create o { ? {o public method foo {} {return foo}} "::o: unable to dispatch method 'method'" @@ -22,7 +22,7 @@ nx::configure plain-object-method-warning on -nx::Test case plain-methods-1 { +nx::test case plain-methods-1 { nx::Class create M1 nx::Object create o { :public method foo {} {return [:pm1]} @@ -66,7 +66,7 @@ # # delete class method, class property, class variable # -nx::Test case plain-methods-2 { +nx::test case plain-methods-2 { nx::Object create ::o { :public method foo {} {return foo} :property -accessor public p @@ -94,7 +94,7 @@ # require method # -nx::Test case plain-methods-3 { +nx::test case plain-methods-3 { nsf::method::provide set {::nsf::method::alias set -frame object ::set} Index: tests/properties.test =================================================================== diff -u -re0419345b49587b5738f87c6d828dfc5ae4b3276 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/properties.test (.../properties.test) (revision e0419345b49587b5738f87c6d828dfc5ae4b3276) +++ tests/properties.test (.../properties.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -16,7 +16,7 @@ # # Test class-level properties and variables without -incremental # -nx::Test case class-level { +nx::test case class-level { nx::Class create C { :property {a a1} @@ -206,7 +206,7 @@ # # test class-level properties and variables with -incremental # -nx::Test case class-level-incremental { +nx::test case class-level-incremental { nx::Class create CC { :property -incremental {a a1} @@ -377,7 +377,7 @@ # # Test object-level properties and variables without -incremental # -nx::Test case object-level { +nx::test case object-level { nx::Object create o1 { :object property {a a1} @@ -511,7 +511,7 @@ # # test object-level properties and variables with -incremental # -nx::Test case object-level-incremental { +nx::test case object-level-incremental { nx::Object create o1 { :object property -incremental {a a1} @@ -681,7 +681,7 @@ # # check performance of class-level configure and cget # -nx::Test case class-object-properties { +nx::test case class-object-properties { nx::Class create C { :property {a a1} @@ -713,11 +713,11 @@ ##################################################################### # performance tests ##################################################################### -nx::Test parameter count 10000 +nx::test configure -count 10000 # # check performance of class-level configure and cget # -nx::Test case class-level-perf { +nx::test case class-level-perf { nx::Class create C { :property {a a1} @@ -795,7 +795,7 @@ # check performance of class-level configure and cget # -nx::Test case object-level-perf { +nx::test case object-level-perf { nx::Object create o1 { :object property {a a1} Index: tests/protected.test =================================================================== diff -u -r2872e1f0a6523c7fb44952492e05414c4f8d9c84 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/protected.test (.../protected.test) (revision 2872e1f0a6523c7fb44952492e05414c4f8d9c84) +++ tests/protected.test (.../protected.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -2,9 +2,9 @@ package require nx package require nx::test -nx::Test parameter count 1 +nx::test configure -count 1 -nx::Test case call-protected { +nx::test case call-protected { nx::Class create C { :public alias SET ::set :public method foo {} {return [current method]} @@ -82,7 +82,7 @@ # Allow to call methods as filters even if these are protected or # private. # -nx::Test case protected+filter { +nx::test case protected+filter { nx::Class create C { :method f1 args { next } :private method f2 args { next } @@ -102,7 +102,7 @@ } -nx::Test case redefined-protected { +nx::test case redefined-protected { nx::Class create C { :public alias SET ::set :public method foo {} {return [current method]} @@ -154,7 +154,7 @@ # Use case for private: # Hide "helper methods of e.g. mixin" # -nx::Test case private-helper { +nx::test case private-helper { nx::Class create B { :public method bar {} {return "B.bar [next]"} @@ -208,7 +208,7 @@ # Use case for private: # Hide "helper object specific helper methods" # -nx::Test case object-private-helper { +nx::test case object-private-helper { nx::Class create B { :public method bar {} {return "B.bar [next]"} @@ -262,7 +262,7 @@ # # Check local + filter # -nx::Test case local+filter { +nx::test case local+filter { nx::Class create C { :method f1 args { return "f1 [next]" } :public method foo {} { return "C.foo [: -local bar]"} @@ -307,7 +307,7 @@ # # test private # -nx::Test case private { +nx::test case private { nx::Class create B { :private method p1 {} {return B.p1} :private method p2 {} {return B.p2} @@ -393,7 +393,7 @@ # test ": -local" on classes # -nx::Test case class-my-local { +nx::test case class-my-local { nx::Class create Base { :private method baz {a b} { expr {$a + $b} } :public method foo {a b} {: -local baz $a $b} @@ -414,7 +414,7 @@ # # test ": -local" on objects # -nx::Test case object-my-local { +nx::test case object-my-local { nx::Class create M { :public method foo {} {return "M [next]"} :public method foo2 {} {return "M2 [next]"} @@ -441,7 +441,7 @@ # test "my" + path instead of ": -local" on classes # -nx::Test case my+handle-instead-of-my-local { +nx::test case my+handle-instead-of-my-local { nx::Class create Base { :private method privateMethod {a b} { expr {$a + $b} } :public method foo {a b} {: [Base info method registrationhandle privateMethod] $a $b} @@ -462,7 +462,7 @@ # test object::dispatch instead of ": -local" on classes # -nx::Test case dispatch-instead-of-my-local { +nx::test case dispatch-instead-of-my-local { nx::Class create Base { :private method privateMethod {a b} { expr {$a + $b} } :public method foo {a b} { dispatch [self] [Base info method registrationhandle privateMethod] $a $b } @@ -482,7 +482,7 @@ # # Test -system flag on dispatch with explicit receiver # -nx::Test case system-flag { +nx::test case system-flag { # # create an object, which overloads some system behavior @@ -540,7 +540,7 @@ # private methods # -nx::Test case class-my-local+next { +nx::test case class-my-local+next { nx::Class create Base { :private method baz {a b} { expr {$a + $b} } @@ -612,7 +612,7 @@ # Test setting / clearing private and protected flags # -nx::Test case call-protected-flags { +nx::test case call-protected-flags { Class create C C protected method foo {} {return foo} @@ -646,7 +646,7 @@ # # private subobjects # -nx::Test case private-subobject { +nx::test case private-subobject { nx::Object create obj { :public object method foo {} {return foo-[self]} nx::Object create [self]::child { @@ -687,7 +687,7 @@ # # Test protected and private object properties # -nx::Test case protected-priv-class-property { +nx::test case protected-priv-class-property { nx::Class create C { :property -accessor public {a a1} :property -accessor protected {b b1} @@ -772,7 +772,7 @@ # Test properties in class hierarchy, where a subclass defines a # private property with the same name as a property in a superclass. # -nx::Test case private-shadows-public-property { +nx::test case private-shadows-public-property { nx::Class create C { :property -accessor public {x c} } @@ -794,7 +794,7 @@ # # Test protected and private class properties # -nx::Test case protected-priv-object-property { +nx::test case protected-priv-object-property { nx::Object create o { :object property -accessor public {a a1} :object property -accessor protected {b b1} @@ -830,7 +830,7 @@ # # Test protected and private class object properties # -nx::Test case protected-priv-class-object-property { +nx::test case protected-priv-class-object-property { nx::Class create C { :object property -accessor public {a a1} :object property -accessor protected {b b1} Index: tests/returns.test =================================================================== diff -u -rfc77eaadabdd690239694a6f1cf155a7d16b5cd4 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/returns.test (.../returns.test) (revision fc77eaadabdd690239694a6f1cf155a7d16b5cd4) +++ tests/returns.test (.../returns.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -12,8 +12,8 @@ # ::nsf::configure checkresult true -nx::Test parameter count 10000 -nx::Test case int-returns { +nx::test configure -count 10000 +nx::test case int-returns { nx::Class create C { # scripted method without paramdefs :method bar-ok1 {a b} {return 1} @@ -62,8 +62,8 @@ } -nx::Test parameter count 10 -nx::Test case app-specific-returns { +nx::test configure -count 10 +nx::test case app-specific-returns { ::nx::methodParameterSlot object method type=range {name value arg} { foreach {min max} [split $arg -] break @@ -98,8 +98,8 @@ ? {c1 lappend l e1} {Value 'e1' of parameter return-value not between 1 and 30} } -nx::Test parameter count 1000 -nx::Test case converting-returns { +nx::test configure -count 1000 +nx::test case converting-returns { ::nx::methodParameterSlot object method type=sex {name value args} { #puts stderr "[current] slot specific converter" @@ -154,8 +154,8 @@ # ::nsf::configure checkresults false -::nx::Test parameter count 1000 -::nx::Test case int-returns-nocheck { +::nx::test configure -count 1000 +::nx::test case int-returns-nocheck { nx::Class create C { # scripted method without paramdefs :method bar-ok1 {a b} {return 1} @@ -198,8 +198,8 @@ ? {::nsf::method::property ::nx::Class method returns} "" } -::nx::Test parameter count 10 -::nx::Test case app-specific-returns-nocheck { +::nx::test configure -count 10 +::nx::test case app-specific-returns-nocheck { ::nx::methodParameterSlot object method type=range {name value arg} { foreach {min max} [split $arg -] break @@ -234,8 +234,8 @@ ? {c1 lappend l e1} e1 } -::nx::Test parameter count 1000 -::nx::Test case converting-returns-nocheck { +::nx::test configure -count 1000 +::nx::test case converting-returns-nocheck { ::nx::methodParameterSlot object method type=sex {name value args} { #puts stderr "[current] slot specific converter" @@ -294,7 +294,7 @@ ::nsf::configure checkresults true -::nx::Test case int-returns-sugar { +::nx::test case int-returns-sugar { nx::Class create C { # scripted method without paramdefs :method bar-ok1 {a b} -returns integer {return 1} @@ -354,7 +354,7 @@ } -::nx::Test case empty-paramdefs-robustedness { +::nx::test case empty-paramdefs-robustedness { ::nx::Object create ku { # 1: Create an empty or checker-free parameter spec :object method foo {} {;} Index: tests/serialize.test =================================================================== diff -u -r2872e1f0a6523c7fb44952492e05414c4f8d9c84 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/serialize.test (.../serialize.test) (revision 2872e1f0a6523c7fb44952492e05414c4f8d9c84) +++ tests/serialize.test (.../serialize.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -3,7 +3,7 @@ package req nx::test package req nx::serializer -nx::Test case deepSerialize-map-filter { +nx::test case deepSerialize-map-filter { Object create ::a { :object property -accessor public ref:object,type=[:info class] @@ -51,7 +51,7 @@ ? {::a::c eval {set :parentRef}} ::a } -nx::Test case deepSerialize-ignoreVarsRE-filter { +nx::test case deepSerialize-ignoreVarsRE-filter { nx::Class create C { :object property -accessor public x :object property -accessor public y @@ -113,7 +113,7 @@ } } -nx::Test case deepSerialize-ignore-filter { +nx::test case deepSerialize-ignore-filter { Object create ::a { Object create [self]::b Object create [self]::c @@ -143,7 +143,7 @@ ? {::nsf::object::exists ::a} 0 } -nx::Test case serialize-slotContainer { +nx::test case serialize-slotContainer { nx::Class create C { :object property x @@ -176,7 +176,7 @@ # check whether ::nsf::object::properties keepcallerself and # perobjectdispatch for nx::Objects are handled correctly via serialize # -nx::Test case serialize-object-properties { +nx::test case serialize-object-properties { # # Check on object o Index: tests/submethods.test =================================================================== diff -u -r7ba7b3c49ff542688258f50fba2fc8102f23a011 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/submethods.test (.../submethods.test) (revision 7ba7b3c49ff542688258f50fba2fc8102f23a011) +++ tests/submethods.test (.../submethods.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -1,11 +1,11 @@ # -*- Tcl -*- package req nx -::nx::configure defaultMethodCallProtection false package require nx::test -#namespace import ::nx::* -nx::Test parameter count 100 -nx::Test case submethods { +::nx::configure defaultMethodCallProtection false + +nx::test configure -count 100 +nx::test case submethods { #Object method unknown {} {} Object create o1 ? {o1 foo} "::o1: unable to dispatch method 'foo'" @@ -63,8 +63,8 @@ #unable to dispatch method baz a m3; valid subcommands of a: m1 m2} # -nx::Test parameter count 1 -nx::Test case defaultmethod { +nx::test configure -count 1 +nx::test case defaultmethod { Object create o { :object method "string length" x {return [current method]} :object method "string tolower" x {return [current method]} @@ -96,8 +96,8 @@ # # testing ensemble objects with next # -nx::Test parameter count 1 -nx::Test case ensemble-next { +nx::test configure -count 1 +nx::test case ensemble-next { nx::Class create FOO { # reduced ensemble @@ -179,7 +179,7 @@ ? {f1 l1 l2 l3a 100} "{M1.l1 l2 l3a//l3a (100)} {l1 l2//l2 (l3a 100)} {FOO.l1 l2 l3a//l3a (100)}" } -nx::Test case ensemble-partial-next { +nx::test case ensemble-partial-next { nx::Class create M { :public method "info has namespace" {} { nx::next @@ -242,7 +242,7 @@ # # Check behavior of upvars in ensemble methods # -nx::Test case ensemble-upvar { +nx::test case ensemble-upvar { nx::Class create FOO { :method "bar0 x" {varname} {upvar $varname v; return [info exists v]} @@ -265,7 +265,7 @@ # # Check behavior of next with arguments within an ensemble # -nx::Test case ensemble-next-with-args { +nx::test case ensemble-next-with-args { nx::Object create o { :object method foo {x} {return $x} :object method "e1 sm" {x} {return $x} @@ -298,8 +298,8 @@ ? {o e1 e1 e1} {e1 e1 e1} } -nx::Test parameter count 1 -nx::Test case ensemble-next-with-colon-prefix +nx::test configure -count 1 +nx::test case ensemble-next-with-colon-prefix namespace eval ::ns1 { nx::Object create obj { :public object method foo {} { return [:info class] } @@ -348,7 +348,7 @@ # Leaf next: Do not trigger unknown handling (see also # NextSearchAndInvoke()) # -nx::Test case leaf-next-in-submethods { +nx::test case leaf-next-in-submethods { nx::Object create container { set :x 0 :public object method "FOO bar" {} { @@ -366,7 +366,7 @@ } -nx::Test case submethods-and-filters { +nx::test case submethods-and-filters { # # submethods as filters? # @@ -376,7 +376,7 @@ #C filter {{BAR bar}} } -nx::Test case submethods-current-introspection { +nx::test case submethods-current-introspection { # # [current] & [current class] # @@ -522,7 +522,7 @@ # # Test current args in ensemble methods # -nx::Test case current-args { +nx::test case current-args { nx::Class create C { :method foo {{-x 1} z:optional} {return [current args]} :method "bar foo" {{-x 1} z:optional} {return [current args]} @@ -542,7 +542,7 @@ # method interface # -nx::Test case per-object-dispatch { +nx::test case per-object-dispatch { nx::Class create C { :public method foo {} {return foo-[self]} :public method baz {} {return [c1::1 baz]} @@ -618,8 +618,8 @@ # Test forwarding to child object, with respect to settings of the # object properties keepcallerself and allowmethoddispatch # -nx::Test parameter count 1000 -nx::Test case child-obj-delegation { +nx::test configure -count 1000 +nx::test case child-obj-delegation { nx::Object create obj { nx::Object create [self]::child { @@ -727,8 +727,8 @@ # Examplify the current behavior of "keepcallerself" with and without # the setting of "perobjectdispatch" # -nx::Test parameter count 1 -nx::Test case keepcallerself { +nx::test configure -count 1 +nx::test case keepcallerself { nx::Class create C {:public method foo {} {return C-[self]}} nx::Class create D {:public method foo {} {return D-[self]}} Index: tests/tcl86.test =================================================================== diff -u -r1aecbfc509cbbcf0861cffb65f980b3d78ee3dc5 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/tcl86.test (.../tcl86.test) (revision 1aecbfc509cbbcf0861cffb65f980b3d78ee3dc5) +++ tests/tcl86.test (.../tcl86.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -8,7 +8,7 @@ # # Test coroutine / yield # -nx::Test case number-generator { +nx::test case number-generator { nx::Object create ::numbers { # set instance variable used in coroutine set :delta 2 @@ -38,7 +38,7 @@ # # Test coroutine / yield # -nx::Test case enumerator1 { +nx::test case enumerator1 { # # enumerator with yield in a single class @@ -79,7 +79,7 @@ } -nx::Test case enumerator2 { +nx::test case enumerator2 { # # Define separate classes for Yielder and Enumerator @@ -209,7 +209,7 @@ # # apply # -nx::Test case apply { +nx::test case apply { # Register apply as an alias ::nx::Object public alias apply ::apply Index: tests/tcloo.test =================================================================== diff -u -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/tcloo.test (.../tcloo.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ tests/tcloo.test (.../tcloo.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -84,7 +84,7 @@ } nx::Class mixin add ExportUnexportUtil -nx::Test case export { +nx::test case export { # # Exporting existing, non-inherited method (see TclOO tests, # oo.test, oo-4.1) @@ -175,7 +175,7 @@ } -nx::Test case unexport { +nx::test case unexport { # A solitary, preemptive [unexport]: see description for the # corresponding [export] case Index: tests/var-access.test =================================================================== diff -u -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/var-access.test (.../var-access.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ tests/var-access.test (.../var-access.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -18,7 +18,7 @@ } -nx::Test case set+array { +nx::test case set+array { nx::Object create o1 # first set a scalar variable @@ -61,8 +61,8 @@ ? {nsf::var::unset -nocomplain o1 x} "" } -nx::Test parameter count 10000 -nx::Test case dummy { +nx::test configure -count 10000 +nx::test case dummy { nx::Object create o { set :x 1 } Index: tests/varresolution.test =================================================================== diff -u -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/varresolution.test (.../varresolution.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ tests/varresolution.test (.../varresolution.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -3,10 +3,10 @@ # testing var resolution # package require nx -::nx::configure defaultMethodCallProtection false package require nx::test -namespace import ::nx::* +::nx::configure defaultMethodCallProtection false + ::nsf::method::alias ::nx::Object objeval -frame object ::eval ::nsf::method::alias ::nx::Object array -frame object ::array ::nsf::method::alias ::nx::Object lappend -frame object ::lappend @@ -18,9 +18,9 @@ # Basic tests for var resolution under # per-object namespaces ... ########################################### -Test case globals +nx::test case globals set ::globalVar 1 -Object create o +nx::Object create o o require namespace ? {o info vars} "" ? {info exists ::globalVar} 1 @@ -40,10 +40,10 @@ ########################################### # scopes ########################################### -Test case scopes +nx::test case scopes -Object create o -Object create o2 {set :i 1} +nx::Object create o +nx::Object create o2 {set :i 1} o objeval { # require an namespace within an objscoped frame; it is necessary to replace # vartables on the stack @@ -103,8 +103,8 @@ # like the example above, but with the non-leaf initcmd -Object create o2 {set :i 1} -Object create o { +nx::Object create o2 {set :i 1} +nx::Object create o { :require namespace global g ::nsf::var::import o2 i @@ -137,10 +137,10 @@ ########################################### # var exists tests ########################################### -Test case exists { +nx::test case exists { set y 1 - Object create o {set :x 1} + nx::Object create o {set :x 1} o object method foo {} {info exists :x} o object method bar {} {info exists :y} ? {o eval {info exists :x}} 1 @@ -160,9 +160,9 @@ ########################################### # mix & match namespace and object interfaces ########################################### -Test case namespaces +nx::test case namespaces -Object create o +nx::Object create o o require namespace o set x 1 ? {namespace eval ::o {set x}} 1 @@ -184,9 +184,9 @@ ########################################### # array-specific tests ########################################### -Test case namespaces-array +nx::test case namespaces-array -Object create o +nx::Object create o o require namespace ? {o array exists a} 0 @@ -210,10 +210,10 @@ ########################################### # tests on namespace-qualified var names ########################################### -Test case namespaced-var-names -Object create o +nx::test case namespaced-var-names +nx::Object create o o require namespace -Object create o::oo +nx::Object create o::oo o::oo require namespace ? {::o set ::x 1} 1 @@ -242,7 +242,7 @@ # the tests below fail. We could consider # to require namespaces on the fly in the future -#Object create o +#nx::Object create o #? {::o set ::o::x 1} 1 #? {o exists x} [::o set ::o::x] #? {namespace eval ::o unset x} "" @@ -258,8 +258,8 @@ ############################################### # tests for the compiled var resolver on Object ############################################### -Test case var-resolver-object -Object create o +nx::test case var-resolver-object +nx::Object create o o object method foo {x} {set :y 2; return ${:x},${:y}} o object method bar {} {return ${:x},${:y}} o set x 1 @@ -268,7 +268,7 @@ ? {o info vars} "x y" # recreate object, check var caching; # we have to recreate bar, so no problem -Object create o +nx::Object create o o set x 1 o object method bar {} {return ${:x},${:y}} ? {catch {o bar}} "1" "compiled var y should not exist" @@ -277,8 +277,8 @@ ############################################### # tests for the compiled var resolver on Class ############################################### -Test case var-resolver-class -Class create C {:property {x 1}} +nx::test case var-resolver-class +nx::Class create C {:property {x 1}} C create c1 C method foo {x} {set :y 2; return ${:x},${:y}} C method bar {} {return ${:x},${:y}} @@ -301,8 +301,8 @@ ############################################### # tests for the compiled var resolver with eval ############################################### -Test case compiled-var-resolver -Class create C {:property {x 1}} +nx::test case compiled-var-resolver +nx::Class create C {:property {x 1}} C create c1 C method foo {x} { set :y 2; @@ -335,7 +335,7 @@ # tests with array ############################################### -Class create C +nx::Class create C C create c1 C method foo {} { array set :a {a 1 b 2 c 3} @@ -348,8 +348,8 @@ ############################################### # tests for the var resolver ############################################### -Test case var-resolver -Class create C +nx::test case var-resolver +nx::Class create C C method bar0 {} {return ${:x}} C method bar1 {} {set a ${:x}; return [info exists :x],[info exists :y]} C method bar2 {} {return [info exists :x],[info exists :y]} @@ -371,7 +371,7 @@ ############################################### # first tests for the cmd resolver ############################################### -Class create C +nx::Class create C C method bar {args} { #puts stderr "[current] bar called with [list $args]" return $args @@ -401,7 +401,7 @@ set ::w 1 array set ::tmpArray {key value} -Class create ::C +nx::Class create ::C ::nsf::method::alias ::C Set -frame object ::set ::nsf::method::alias ::C Unset -frame object ::unset @@ -426,14 +426,14 @@ # -varscope flags and with a # required namespace and without ################################################## -Test case eval-variants +nx::test case eval-variants ::nsf::method::alias ::nx::Object objeval -frame object ::eval ::nsf::method::alias ::nx::Object softeval -frame method ::eval ::nsf::method::alias ::nx::Object softeval2 ::eval set G 1 -Object create o { +nx::Object create o { set xxx 1 set :x 1 ? {info exists G} 1 @@ -487,7 +487,7 @@ o destroy # now with an object namespace -Object create o +nx::Object create o o require namespace # objeval does an objcope, all vars are instance variables @@ -520,10 +520,10 @@ # The same as above, but with some global vars. The global vars # should not influence the behavior on instance variables ################################################################# -Test case with-global-vars +nx::test case with-global-vars foreach var {.x x xxx :a a aaa :b b bbb :c c ccc :d d ddd :z z zzz} {set $var 1} -Object create o { +nx::Object create o { set xxx 1 set :x 1 } @@ -558,7 +558,7 @@ o destroy # now with namespace -Object create o +nx::Object create o o require namespace # eval does an objcope, all vars are instance variables @@ -590,15 +590,15 @@ ################################################## # Test with proc scopes ################################################## -Test case proc-scopes +nx::test case proc-scopes ::nsf::method::alias ::nx::Object objscoped-eval -frame object ::eval ::nsf::method::alias ::nx::Object nonleaf-eval -frame method ::eval ::nsf::method::alias ::nx::Object plain-eval ::eval proc foo-via-initcmd {} { foreach v {x xxx} {unset -nocomplain ::$v} set p 1 - Object create o { + nx::Object create o { set xxx 1 set :x 1 set ::result G=[info exists G],p=[info exists p] @@ -609,7 +609,7 @@ proc foo {type} { foreach v {x xxx} {unset -nocomplain ::$v} set p 1 - Object create o + nx::Object create o o $type { set xxx 1 set :x 1 @@ -646,10 +646,10 @@ ################################################## # dotCmd tests ################################################## -Test case dotcmd +nx::test case dotcmd set C 0 proc bar {} {incr ::C} -Class create Foo { +nx::Class create Foo { :method init {} {set :c 0} :method callDot1 {} {:bar} :method callDot2 {} {:bar} @@ -670,7 +670,7 @@ # # Test vwait with colon variable and vwait method # -Object create o { +nx::Object create o { set :x 0 :public object method foo {} {incr :x} :public object method vwait {varName} { @@ -716,11 +716,11 @@ ################################################## # test for namespace resolver ################################################## -Test case nsresolver +nx::test case nsresolver namespace eval module { - Class create C - Class create M1 - Class create M2 + nx::Class create C + nx::Class create M1 + nx::Class create M2 C mixin M1 ? {::nsf::relation C class-mixin} "::module::M1" @@ -736,9 +736,9 @@ # of an eval (one case uses compiler) ################################################## -Test case alias-dot-resolver-interp +nx::test case alias-dot-resolver-interp # outside of eval scope (interpreted) -Class create V { +nx::Class create V { set :Z 1 set ZZZ 1 :method bar {z} { return $z } @@ -753,9 +753,9 @@ # dot-resolver/ dot-dispatcher used in aliased proc -Test case alias-dot-resolver { +nx::test case alias-dot-resolver { - Class create V { + nx::Class create V { set :Z 1 set ZZZ 1 :method bar {z} { return $z } @@ -773,9 +773,9 @@ # test [info vars] in eval method # -Test case info-vars-in-eval { +nx::test case info-vars-in-eval { - Object create o + nx::Object create o ? {o eval { set x 1 expr {[info vars "x"] eq "x"} @@ -786,8 +786,8 @@ # test for former crash when variable is used in connection with # prefixed variables # -Test case tcl-variable-cmd { - Object create o { +nx::test case tcl-variable-cmd { + nx::Object create o { :public object method ? {varname} {info exists :$varname} :public object method bar args { variable :a @@ -811,7 +811,7 @@ ? {lsort [o info vars]} a } -Test case interactions { +nx::test case interactions { # SS: Adding an exemplary test destilled from the behaviour observed # for AOLserver vs. NaviServer when introspecting object variables @@ -820,7 +820,7 @@ # non-compiling var resolvers and (b) compiled and non-compiled # script execution - Object create ::o { + nx::Object create ::o { :public object method bar {} { # 1. creates a proc-local, compiled var "type" set type 1 @@ -912,7 +912,7 @@ # this has some implications ... namespace eval ::ns1 { - Object create o { + nx::Object create o { :public object method foo {} { set _ [join [list {*}[lsort [info vars :*]] [info locals :*] \ [info exists w] [::nsf::var::exists [::nsf::current] w] \ @@ -1035,7 +1035,7 @@ # accessing of object state ... # - Object create p { + nx::Object create p { :public object method foo {var} { set :x XXX set _ ${:x} @@ -1108,19 +1108,19 @@ } } -Test case after-next { +nx::test case after-next { # # This test case tests, whether we can use e..g an instvar in an # mixin method after the next. In such cases, the frame flags have # to be altered from inactive mixin to active mixin (otherwise the # actual frame would be skipped in useActiveFrames below in :instvar). # - Class create FormPage { + nx::Class create FormPage { :property package_id :public method initialize_loaded_object {} {;} } - Class create WorkflowPage { + nx::Class create WorkflowPage { :alias instvar :::nsf::methods::object::instvar :public method initialize_loaded_object {} { next @@ -1135,11 +1135,11 @@ } } -Test case unconfigured-varresolver { +nx::test case unconfigured-varresolver { # # Test robustness of varresolver for unconfigured objects # - Class create O { + nx::Class create O { :public method configure args {;} :create ateh } @@ -1151,7 +1151,7 @@ # (lambda frames) # -::nx::Test case var-resolver-uplevel-apply { +::nx::test case var-resolver-uplevel-apply { nx::Object create o1 { set :a o1.a Index: tests/volatile.test =================================================================== diff -u -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r45e24b34c85bf0fc3e14db5250550100bd07ff31 --- tests/volatile.test (.../volatile.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ tests/volatile.test (.../volatile.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) @@ -68,20 +68,20 @@ } D create d1 -nx::Test case methods-methods { +nx::test case methods-methods { d1 foox d1 foon } -nx::Test case methods-procs { +nx::test case methods-procs { d1 foox2 d1 foon2 } # # Call just in tcl procs # -nx::Test case procs-procs { +nx::test case procs-procs { ::foox ::foon } \ No newline at end of file