Index: tests/properties.test =================================================================== diff -u -r71eb8c412adf8946fa4930dd00f27898773ae266 -r23b10a2c736cf33731b0d7b0381314ddec44f2d6 --- tests/properties.test (.../properties.test) (revision 71eb8c412adf8946fa4930dd00f27898773ae266) +++ tests/properties.test (.../properties.test) (revision 23b10a2c736cf33731b0d7b0381314ddec44f2d6) @@ -33,15 +33,15 @@ # a non-configurable property is a variable :property -accessor none -configurable false {vf vf1} - :public method call-local {v} {: -local $v} + :public method call-local {v} {: -local $v get} :create c1 } # # just the public properties are accessible via the configure interface # - ? {c1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info lookup configure syntax} { ?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {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" @@ -126,24 +126,24 @@ # ? {c1 a} {::c1: unable to dispatch method 'a'} - ? {c1 b} b1 + ? {c1 b get} b1 ? {c1 c} {::c1: unable to dispatch method 'c'} ? {c1 d} {::c1: unable to dispatch method 'd'} ? {c1 eval ":a"} {::c1: unable to dispatch method 'a'} - ? {c1 eval ":b"} b1 - ? {c1 eval ":c"} c1 + ? {c1 eval ":b get"} b1 + ? {c1 eval ":c get"} c1 ? {c1 eval ":d"} {::c1: unable to dispatch method 'd'} ? {c1 va} {::c1: unable to dispatch method 'va'} - ? {c1 vb} vb1 + ? {c1 vb get} vb1 ? {c1 vc} {::c1: unable to dispatch method 'vc'} ? {c1 vd} {::c1: unable to dispatch method 'vd'} ? {c1 eval ":va"} {::c1: unable to dispatch method 'va'} - ? {c1 eval ":vb"} vb1 - ? {c1 eval ":vc"} vc1 + ? {c1 eval ":vb get"} vb1 + ? {c1 eval ":vc get"} vc1 ? {c1 eval ":vd"} {::c1: unable to dispatch method 'vd'} # @@ -160,9 +160,12 @@ # cases) # - ? {c1 b add x} {wrong # args should be "::c1 b ?value?"} + set unknowns "valid are: {assign definition destroy get getParameterSpec getPropertyDefinitionOptions onError parameter reconfigure setCheckedInstVar}" + ? {c1 b add x} {property b of ::C ist not multivalued} + #? {c1 b add x} "method 'add' unknown for slot ::C::slot::b; $unknowns" ? {c1 c add x} {::c1: unable to dispatch method 'c'} - ? {c1 eval {:c add x}} {wrong # args should be "::c1 c ?value?"} + ? {c1 eval {:c add x}} {property c of ::C ist not multivalued} + #? {c1 eval {:c add x}} "method 'add' unknown for slot ::C::slot::c; $unknowns" ? {c1 d add x} {::c1: unable to dispatch method 'd'} ? {c1 eval {:d add x}} {::c1: unable to dispatch method 'd'} ? {c1 e add x} {::c1: unable to dispatch method 'e'} @@ -173,9 +176,11 @@ # ? {c1 va add x} {::c1: unable to dispatch method 'va'} - ? {c1 vb add x} {wrong # args should be "::c1 vb ?value?"} + ? {c1 vb add x} {property vb of ::C ist not multivalued} + #? {c1 vb add x} "method 'add' unknown for slot ::C::slot::vb; $unknowns" ? {c1 vc add x} {::c1: unable to dispatch method 'vc'} - ? {c1 eval {:vc add x}} {wrong # args should be "::c1 vc ?value?"} + ? {c1 eval {:vc add x}} {property vc of ::C ist not multivalued} + #? {c1 eval {:vc add x}} "method 'add' unknown for slot ::C::slot::vc; $unknowns" ? {c1 vd add x} {::c1: unable to dispatch method 'vd'} ? {c1 eval {:vd add x}} {::c1: unable to dispatch method 'vd'} ? {c1 ve add x} {::c1: unable to dispatch method 've'} @@ -185,7 +190,7 @@ # The accessor should be a setter due to incremental # - ? {C info method definition b} {::C public setter b} + ? {C info method definition b} {::C public forward b -prefix value= ::C::slot::b %1 %self b} # # check error message on a typo. The following command does a @@ -221,7 +226,7 @@ :variable -accessor private -incremental vd vd1 :variable -accessor none -incremental ve ve1 - :public method call-local {v} {: -local $v} + :public method call-local {v} {: -local $v get} :public method add-local {var value} {: -local $var add $value} :create c1 @@ -230,7 +235,7 @@ # # The use of "-incremental" implies multivalued # - ? {c1 info configure} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info lookup configure syntax} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {c1 cget -a} a1 ? {c1 cget -b} b1 @@ -294,26 +299,26 @@ # can we call the accessor directly or via "eval" # - ? {c1 a} a1 - ? {c1 b} b1 + ? {c1 a get} a1 + ? {c1 b get} b1 ? {c1 c} {::c1: unable to dispatch method 'c'} ? {c1 d} {::c1: unable to dispatch method 'd'} - ? {c1 eval ":a"} a1 - ? {c1 eval ":b"} b1 - ? {c1 eval ":c"} c1 + ? {c1 eval ":a get"} a1 + ? {c1 eval ":b get"} b1 + ? {c1 eval ":c get"} c1 ? {c1 eval ":d"} {::c1: unable to dispatch method 'd'} - ? {c1 va} va1 - ? {c1 vb} vb1 + ? {c1 va get} va1 + ? {c1 vb get} vb1 ? {c1 vc} {::c1: unable to dispatch method 'vc'} ? {c1 vd} {::c1: unable to dispatch method 'vd'} - ? {c1 eval ":va"} va1 - ? {c1 eval ":vb"} vb1 - ? {c1 eval ":vc"} vc1 - ? {c1 eval ":vd"} {::c1: unable to dispatch method 'vd'} + ? {c1 eval ":va get"} va1 + ? {c1 eval ":vb get"} vb1 + ? {c1 eval ":vc get"} vc1 + ? {c1 eval ":vd get"} {::c1: unable to dispatch method 'vd'} # # check the behavior of "private" properties and variables @@ -356,7 +361,7 @@ # The accessor should be a forwarder due to incremental # - ? {CC info method definition b} {::CC public forward b ::CC::slot::b {%1 {get assign}} %self b} + ? {CC info method definition b} {::CC public forward b -prefix value= ::CC::slot::b %1 %self b} # # check error message @@ -392,7 +397,7 @@ :object variable -accessor private vd vd1 :object variable -accessor none ve ve1 - :public object method call-local {v} {: -local $v} + :public object method call-local {v} {: -local $v get} } @@ -405,7 +410,7 @@ # just the public properties are accessible via the configure interface # - ? {o1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {o1 info lookup configure syntax} { ?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} # # just the public properties are accessible via the cget interface @@ -474,23 +479,23 @@ # ? {o1 a} {::o1: unable to dispatch method 'a'} - ? {o1 b} b1 + ? {o1 b get} b1 ? {o1 c} {::o1: unable to dispatch method 'c'} ? {o1 d} {::o1: unable to dispatch method 'd'} ? {o1 eval ":a"} {::o1: unable to dispatch method 'a'} - ? {o1 eval ":b"} b1 - ? {o1 eval ":c"} c1 + ? {o1 eval ":b get"} b1 + ? {o1 eval ":c get"} c1 ? {o1 eval ":d"} {::o1: unable to dispatch method 'd'} ? {o1 va} {::o1: unable to dispatch method 'va'} - ? {o1 vb} vb1 + ? {o1 vb get} vb1 ? {o1 vc} {::o1: unable to dispatch method 'vc'} ? {o1 vd} {::o1: unable to dispatch method 'vd'} ? {o1 eval ":va"} {::o1: unable to dispatch method 'va'} - ? {o1 eval ":vb"} vb1 - ? {o1 eval ":vc"} vc1 + ? {o1 eval ":vb get"} vb1 + ? {o1 eval ":vc get"} vc1 ? {o1 eval ":vd"} {::o1: unable to dispatch method 'vd'} # @@ -526,14 +531,14 @@ :object variable -accessor private -incremental vd vd1 :object variable -accessor none -incremental ve ve1 - :public object method call-local {v} {: -local $v} + :public object method call-local {v} {: -local $v get} :public object method add-local {var value} {: -local $var add $value} } # # The use of "-incremental" implies multivalued # - ? {o1 info configure} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {o1 info lookup configure syntax} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {o1 cget -a} a1 ? {o1 cget -b} b1 @@ -597,25 +602,25 @@ # can we call the accessor directly or via "eval" # - ? {o1 a} a1 - ? {o1 b} b1 + ? {o1 a get} a1 + ? {o1 b get} b1 ? {o1 c} {::o1: unable to dispatch method 'c'} ? {o1 d} {::o1: unable to dispatch method 'd'} - ? {o1 eval ":a"} a1 - ? {o1 eval ":b"} b1 - ? {o1 eval ":c"} c1 + ? {o1 eval ":a get"} a1 + ? {o1 eval ":b get"} b1 + ? {o1 eval ":c get"} c1 ? {o1 eval ":d"} {::o1: unable to dispatch method 'd'} - ? {o1 va} va1 - ? {o1 vb} vb1 + ? {o1 va get} va1 + ? {o1 vb get} vb1 ? {o1 vc} {::o1: unable to dispatch method 'vc'} ? {o1 vd} {::o1: unable to dispatch method 'vd'} - ? {o1 eval ":va"} va1 - ? {o1 eval ":vb"} vb1 - ? {o1 eval ":vc"} vc1 + ? {o1 eval ":va get"} va1 + ? {o1 eval ":vb get"} vb1 + ? {o1 eval ":vc get"} vc1 ? {o1 eval ":vd"} {::o1: unable to dispatch method 'vd'} # @@ -659,7 +664,7 @@ # The accessor should be a forwarder due to incremental # - ? {o1 info object method definition b} {::o1 public object forward b ::o1::per-object-slot::b {%1 {get assign}} %self b} + ? {o1 info object method definition b} {::o1 public object forward b -prefix value= ::o1::per-object-slot::b %1 %self b} # # check error message @@ -678,22 +683,22 @@ # Tests for experimental "value add", "value assign" ... # -nx::test case property-value-incremental { +# nx::test case property-value-incremental { - nx::Object create o1 { - :object property -incremental {a a1} - } +# nx::Object create o1 { +# :object property -incremental {a a1} +# } - ? {o1 a add x} {x a1} - ? {o1 a {a1}} {a1} +# ? {o1 a add x} {x a1} +# ? {o1 a assign {a1}} {a1} - nsf::configure debug 2 - ? {o1 a value add x } {x a1} - ? {o1 a value assign {a b c}} {a b c} - ? {o1 a value get } {a b c} - ? {o1 a value add x } {x a b c} - ? {o1 a value add z end} {x a b c z} -} +# nsf::configure debug 2 +# ? {o1 a value add x } {x a1} +# ? {o1 a value assign {a b c}} {a b c} +# ? {o1 a value get } {a b c} +# ? {o1 a value add x } {x a b c} +# ? {o1 a value add z end} {x a b c z} +# } # # Test interactions between multiplicity and incremental @@ -722,13 +727,13 @@ ? {o1 info variable definition [o1 info object variables d]} \ "::o1 object property -accessor public -incremental d:integer,1..n" - ? {o1 a {1 2 3}} {1 2 3} - ? {o1 b {1 2 3}} {1 2 3} + ? {o1 a set {1 2 3}} {1 2 3} + ? {o1 b set {1 2 3}} {1 2 3} - ? {o1 a ""} {} - ? {o1 b ""} {invalid value for parameter 'value': list is not allowed to be empty} - ? {o1 c ""} {} - ? {o1 d ""} {invalid value for parameter 'value': list is not allowed to be empty} + ? {o1 a set ""} {} + ? {o1 b set ""} {invalid value for parameter 'value': list is not allowed to be empty} + ? {o1 c set ""} {} + ? {o1 d set ""} {invalid value for parameter 'value': list is not allowed to be empty} } @@ -754,12 +759,12 @@ # just the public properties are accessible via the configure interface # - ? {c1 info configure} {?-a /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info lookup configure syntax} {?-a /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {c1 cget -a} a1 ? {c1 configure -a a2} "" - ? {C info configure} {?-b /value/? ?-superclass /class .../? ?-mixin /mixinreg .../? ?-filter /filterreg .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {C info lookup configure syntax} {?-b /value/? ?-superclass /class .../? ?-mixin /mixinreg .../? ?-filter /filterreg .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {C cget -b} b1 ? {C configure -b b2} "" @@ -814,7 +819,7 @@ # package require nx::volatile - ? {c1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info lookup configure syntax} { ?-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 @@ -833,7 +838,7 @@ # # check influence of class-level per-object properties # - ? {d1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {d1 info lookup configure syntax} { ?-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 @@ -873,7 +878,7 @@ # just the public properties are accessible via the configure interface # - ? {o1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {o1 info lookup configure syntax} { ?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} set e [o1 eval :__objectparameter] @@ -882,8 +887,8 @@ ? {o1 cget -a} a1 ? {o1 configure -a a2} "" - ? {o1 b} b1 - ? {o1 b b2} "b2" + ? {o1 b get} b1 + ? {o1 b set b2} "b2" ? {o1 configure -class ::nx::Object} "" ? {o1 cget -class} ::nx::Object