Index: tests/properties.test =================================================================== diff -u -ra866226c4ca39c65f5f98539c140326c617da884 -rdc9120981daa00d27f8639ea98a71efc2078e0e8 --- tests/properties.test (.../properties.test) (revision a866226c4ca39c65f5f98539c140326c617da884) +++ tests/properties.test (.../properties.test) (revision dc9120981daa00d27f8639ea98a71efc2078e0e8) @@ -16,21 +16,22 @@ # # 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} :property -accessor public {b b1} :property -accessor protected {c c1} :property -accessor private {d d1} :property -accessor none {e e1} - :variable va va1 :variable -accessor public vb vb1 :variable -accessor protected vc vc1 :variable -accessor private vd vd1 :variable -accessor none ve ve1 - :property -accessor none -config false {vf vf1} + + # a non-configurable property is a variable + :property -accessor none -configurable false {vf vf1} :public method call-local {v} {: -local $v} @@ -40,20 +41,34 @@ # # just the public properties are accessible via the configure interface # - ? {c1 configure} { ?-e value? ?-a value? ?-b value? ?-volatile? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?} + ? {c1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} - ? {lsort [C info slot definitions]} {{::C property -accessor none {a a1}} {::C property -accessor none {e e1}} {::C property {b b1}} {::C variable -accessor private d d1} {::C variable -accessor private vd vd1} {::C variable -accessor protected c c1} {::C variable -accessor protected vc vc1} {::C variable -accessor public vb vb1} {::C variable va va1} {::C variable ve ve1} {::C variable vf vf1}} + ? {lsort [C info slots]} "::C::slot::____C.d ::C::slot::____C.vd ::C::slot::a ::C::slot::b ::C::slot::c ::C::slot::e ::C::slot::va ::C::slot::vb ::C::slot::vc ::C::slot::ve ::C::slot::vf" + + + ? {::C::slot::a definition} "::C property -accessor none {a a1}" + ? {::C::slot::b definition} "::C property -accessor public {b b1}" + ? {::C::slot::c definition} "::C variable -accessor protected c c1" + ? {::C::slot::____C.d definition} "::C variable -accessor private d d1" + ? {::C::slot::e definition} "::C property -accessor none {e e1}" + ? {::C::slot::va definition} "::C variable -accessor none va va1" + ? {::C::slot::vb definition} "::C variable -accessor public vb vb1" + ? {::C::slot::vc definition} "::C variable -accessor protected vc vc1" + ? {::C::slot::____C.vd definition} "::C variable -accessor private vd vd1" + ? {::C::slot::ve definition} "::C variable -accessor none ve ve1" + ? {::C::slot::vf definition} "::C variable -accessor none vf vf1" + ? {c1 cget -a} a1 ? {c1 cget -b} b1 - ? {c1 cget -c} {cannot lookup parameter value for -c} - ? {c1 cget -d} {cannot lookup parameter value for -d} - ? {c1 cget -va} {cannot lookup parameter value for -va} - ? {c1 cget -vb} {cannot lookup parameter value for -vb} - ? {c1 cget -vc} {cannot lookup parameter value for -vc} - ? {c1 cget -vd} {cannot lookup parameter value for -vd} - ? {c1 cget -ve} {cannot lookup parameter value for -ve} - ? {c1 cget -vf} {cannot lookup parameter value for -vf} + ? {c1 cget -c} "cget: unknown configure parameter -c" + ? {c1 cget -d} "cget: unknown configure parameter -d" + ? {c1 cget -va} "cget: unknown configure parameter -va" + ? {c1 cget -vb} "cget: unknown configure parameter -vb" + ? {c1 cget -vc} "cget: unknown configure parameter -vc" + ? {c1 cget -vd} "cget: unknown configure parameter -vd" + ? {c1 cget -ve} "cget: unknown configure parameter -ve" + ? {c1 cget -vf} "cget: unknown configure parameter -vf" # # No incremental used, so "a" and "e" have no slots @@ -191,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} @@ -215,16 +230,16 @@ # # The use of "-incremental" implies multivalued # - ? {c1 configure} { ?-e value ...? ?-a value ...? ?-b value ...? ?-volatile? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?} + ? {c1 info configure} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {c1 cget -a} a1 ? {c1 cget -b} b1 - ? {c1 cget -c} {cannot lookup parameter value for -c} - ? {c1 cget -d} {cannot lookup parameter value for -d} - ? {c1 cget -va} {cannot lookup parameter value for -va} - ? {c1 cget -vb} {cannot lookup parameter value for -vb} - ? {c1 cget -vc} {cannot lookup parameter value for -vc} - ? {c1 cget -vd} {cannot lookup parameter value for -vd} + ? {c1 cget -c} "cget: unknown configure parameter -c" + ? {c1 cget -d} "cget: unknown configure parameter -d" + ? {c1 cget -va} "cget: unknown configure parameter -va" + ? {c1 cget -vb} "cget: unknown configure parameter -vb" + ? {c1 cget -vc} "cget: unknown configure parameter -vc" + ? {c1 cget -vd} "cget: unknown configure parameter -vd" # # The use of "-incremental" implies an accessor @@ -362,22 +377,22 @@ # # Test object-level properties and variables without -incremental # -nx::Test case object-level { +nx::test case object-level { nx::Object create o1 { - :property {a a1} - :property -accessor public {b b1} - :property -accessor protected {c c1} - :property -accessor private {d d1} - :property -accessor none {e e1} + :object property {a a1} + :object property -accessor public {b b1} + :object property -accessor protected {c c1} + :object property -accessor private {d d1} + :object property -accessor none {e e1} - :variable va va1 - :variable -accessor public vb vb1 - :variable -accessor protected vc vc1 - :variable -accessor private vd vd1 - :variable -accessor none ve ve1 + :object variable va va1 + :object variable -accessor public vb vb1 + :object variable -accessor protected vc vc1 + :object variable -accessor private vd vd1 + :object variable -accessor none ve ve1 - :public method call-local {v} {: -local $v} + :public object method call-local {v} {: -local $v} } @@ -390,20 +405,20 @@ # just the public properties are accessible via the configure interface # - ? {o1 configure} { ?-e value? ?-a value? ?-b value? ?-volatile? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?} + ? {o1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} # # just the public properties are accessible via the cget interface # ? {o1 cget -a} a1 ? {o1 cget -b} b1 - ? {o1 cget -c} {cannot lookup parameter value for -c} - ? {o1 cget -d} {cannot lookup parameter value for -d} - ? {o1 cget -va} {cannot lookup parameter value for -va} - ? {o1 cget -vb} {cannot lookup parameter value for -vb} - ? {o1 cget -vc} {cannot lookup parameter value for -vc} - ? {o1 cget -vd} {cannot lookup parameter value for -vd} + ? {o1 cget -c} {cget: unknown configure parameter -c} + ? {o1 cget -d} {cget: unknown configure parameter -d} + ? {o1 cget -va} {cget: unknown configure parameter -va} + ? {o1 cget -vb} {cget: unknown configure parameter -vb} + ? {o1 cget -vc} {cget: unknown configure parameter -vc} + ? {o1 cget -vd} {cget: unknown configure parameter -vd} # @@ -490,44 +505,44 @@ # # check error message # - ? {o1 property -accessor proceted {b b1}} {accessor value 'proceted' invalid; might be one of public|protected|private or none} + ? {o1 object property -accessor proceted {b b1}} {accessor value 'proceted' invalid; might be one of public|protected|private or none} } # # test object-level properties and variables with -incremental # -nx::Test case object-level-incremental { +nx::test case object-level-incremental { nx::Object create o1 { - :property -incremental {a a1} - :property -accessor public -incremental {b b1} - :property -accessor protected -incremental {c c1} - :property -accessor private -incremental {d d1} - :property -accessor none -incremental {e e1} + :object property -incremental {a a1} + :object property -accessor public -incremental {b b1} + :object property -accessor protected -incremental {c c1} + :object property -accessor private -incremental {d d1} + :object property -accessor none -incremental {e e1} - :variable -incremental va va1 - :variable -accessor public -incremental vb vb1 - :variable -accessor protected -incremental vc vc1 - :variable -accessor private -incremental vd vd1 - :variable -accessor none -incremental ve ve1 + :object variable -incremental va va1 + :object variable -accessor public -incremental vb vb1 + :object variable -accessor protected -incremental vc vc1 + :object variable -accessor private -incremental vd vd1 + :object variable -accessor none -incremental ve ve1 - :public method call-local {v} {: -local $v} - :public method add-local {var value} {: -local $var add $value} + :public object method call-local {v} {: -local $v} + :public object method add-local {var value} {: -local $var add $value} } # # The use of "-incremental" implies multivalued # - ? {o1 configure} { ?-e value ...? ?-a value ...? ?-b value ...? ?-volatile? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?} + ? {o1 info configure} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {o1 cget -a} a1 ? {o1 cget -b} b1 - ? {o1 cget -c} {cannot lookup parameter value for -c} - ? {o1 cget -d} {cannot lookup parameter value for -d} - ? {o1 cget -va} {cannot lookup parameter value for -va} - ? {o1 cget -vb} {cannot lookup parameter value for -vb} - ? {o1 cget -vc} {cannot lookup parameter value for -vc} - ? {o1 cget -vd} {cannot lookup parameter value for -vd} + ? {o1 cget -c} {cget: unknown configure parameter -c} + ? {o1 cget -d} {cget: unknown configure parameter -d} + ? {o1 cget -va} {cget: unknown configure parameter -va} + ? {o1 cget -vb} {cget: unknown configure parameter -vb} + ? {o1 cget -vc} {cget: unknown configure parameter -vc} + ? {o1 cget -vd} {cget: unknown configure parameter -vd} # # The use of "-incremental" implies an accessor @@ -644,18 +659,18 @@ # The accessor should be a forwarder due to incremental # - ? {o1 info method definition b} {::o1 public forward b ::o1::per-object-slot::b {%1 {get assign}} %self b} + ? {o1 info object method definition b} {::o1 public object forward b ::o1::per-object-slot::b {%1 {get assign}} %self b} # # check error message # - ? {o1 property -accessor proceted {b b1}} {accessor value 'proceted' invalid; might be one of public|protected|private or none} + ? {o1 object property -accessor proceted {b b1}} {accessor value 'proceted' invalid; might be one of public|protected|private or none} # # The accessor is deleted due to the error # - ? {o1 info method definition b} {} + ? {o1 info object method definition b} {} } @@ -666,14 +681,14 @@ # # 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} :variable va va1 - :class property {b b1} - :class variable vb b1 + :object property {b b1} + :object variable vb b1 :create c1 } @@ -682,12 +697,12 @@ # just the public properties are accessible via the configure interface # - ? {c1 configure} {?-a value? ?-volatile? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?} + ? {c1 info configure} {?-a /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {c1 cget -a} a1 ? {c1 configure -a a2} "" - ? {C configure} {?-b value? ?-superclass class ...? ?-object-mixin mixinreg? ?-mixin mixinreg ...? ?-object-filter filterreg? ?-filter filterreg ...? ?-volatile? ?-noinit? ?-class class? ?__initcmd?} + ? {C info configure} {?-b /value/? ?-superclass /class .../? ?-mixin /mixinreg .../? ?-filter /filterreg .../? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {C cget -b} b1 ? {C configure -b b2} "" @@ -698,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} @@ -719,8 +734,9 @@ :create c1 } + nx::Class create D { - :class property {cp 101} + :object property {cp 101} :property {a a1} :property -accessor public {b b1} :property -accessor protected {c c1} @@ -740,7 +756,7 @@ # just the public properties are accessible via the configure interface # - ? {c1 configure} { ?-e value? ?-a value? ?-b value? ?-volatile? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?} + ? {c1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} set e [C eval :__objectparameter] ? {C eval :__objectparameter} $e @@ -759,7 +775,7 @@ # # check influence of class-level per-object properties # - ? {d1 configure} { ?-e value? ?-a value? ?-b value? ?-volatile? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?} + ? {d1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} set e [D eval :__objectparameter] ? {D eval :__objectparameter} $e @@ -779,27 +795,27 @@ # check performance of class-level configure and cget # -nx::Test case object-level-perf { +nx::test case object-level-perf { nx::Object create o1 { - :property {a a1} - :property -accessor public {b b1} - :property -accessor protected {c c1} - :property -accessor private {d d1} - :property -accessor none {e e1} + :object property {a a1} + :object property -accessor public {b b1} + :object property -accessor protected {c c1} + :object property -accessor private {d d1} + :object property -accessor none {e e1} - :variable va va1 - :variable -accessor public vb vb1 - :variable -accessor protected vc vc1 - :variable -accessor private vd vd1 - :variable -accessor none ve ve1 + :object variable va va1 + :object variable -accessor public vb vb1 + :object variable -accessor protected vc vc1 + :object variable -accessor private vd vd1 + :object variable -accessor none ve ve1 } # # just the public properties are accessible via the configure interface # - ? {o1 configure} { ?-e value? ?-a value? ?-b value? ?-volatile? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?} + ? {o1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} set e [o1 eval :__objectparameter]