Index: TODO =================================================================== diff -u -r71015d43732133b53eed552468a6e408d43415eb -r095e1c2332fe7332d648ce194619f15ce1f62c04 --- TODO (.../TODO) (revision 71015d43732133b53eed552468a6e408d43415eb) +++ TODO (.../TODO) (revision 095e1c2332fe7332d648ce194619f15ce1f62c04) @@ -5018,6 +5018,7 @@ value-less slot methods like e.g. "get" dispite of the arity-based forward dispatcher. - extend regression test +- added more test cases for multiplicity and incremental ======================================================================== TODO: Index: library/nx/nx.tcl =================================================================== diff -u -r71015d43732133b53eed552468a6e408d43415eb -r095e1c2332fe7332d648ce194619f15ce1f62c04 --- library/nx/nx.tcl (.../nx.tcl) (revision 71015d43732133b53eed552468a6e408d43415eb) +++ library/nx/nx.tcl (.../nx.tcl) (revision 095e1c2332fe7332d648ce194619f15ce1f62c04) @@ -1854,7 +1854,10 @@ #puts "VariableSlot [self] ${:incremental} && ${:accessor} && ${:multiplicity} incremental ${:incremental}" if {${:incremental}} { if {${:accessor} eq "none"} { set :accessor "public" } - if {![:isMultivalued]} { set :multiplicity "0..n" } + if {![:isMultivalued]} { + puts stderr "=== incremental adds multiplicity" + set :multiplicity "0..n" + } } next :makeAccessor Index: tests/properties.test =================================================================== diff -u -r71015d43732133b53eed552468a6e408d43415eb -r095e1c2332fe7332d648ce194619f15ce1f62c04 --- tests/properties.test (.../properties.test) (revision 71015d43732133b53eed552468a6e408d43415eb) +++ tests/properties.test (.../properties.test) (revision 095e1c2332fe7332d648ce194619f15ce1f62c04) @@ -695,7 +695,33 @@ ? {o1 a value add z end} {x a b c z} } +# +# Test interactions between multiplicity and incremental +# +nx::test case property-incremental-multiplicity { + nx::Object create o1 { + :object property -incremental a:integer,0..n + :object property -incremental b:integer,1..n + } + + ? {o1 info object slots a} "::o1::per-object-slot::a" + ? {[o1 info object slots a] eval {set :multiplicity}} "0..n" + ? {[o1 info object slots b] eval {set :multiplicity}} "1..n" + + ? {o1 info variable definition [o1 info object variables a]} \ + "::o1 object property -accessor public -incremental a:integer,0..n" + ? {o1 info variable definition [o1 info object variables b]} \ + "::o1 object property -accessor public -incremental b:integer,1..n" + + ? {o1 a {1 2 3}} {1 2 3} + ? {o1 b {1 2 3}} {1 2 3} + + ? {o1 a ""} {} + ? {o1 b ""} {invalid value for parameter 'value': list is not allowed to be empty} + +} + ##################################################################### # tests with class object #####################################################################