Index: TODO =================================================================== diff -u -r095e1c2332fe7332d648ce194619f15ce1f62c04 -r71eb8c412adf8946fa4930dd00f27898773ae266 --- TODO (.../TODO) (revision 095e1c2332fe7332d648ce194619f15ce1f62c04) +++ TODO (.../TODO) (revision 71eb8c412adf8946fa4930dd00f27898773ae266) @@ -5019,6 +5019,7 @@ forward dispatcher. - extend regression test - added more test cases for multiplicity and incremental +- preserve lower bound of multiplicity when incemental is added ======================================================================== TODO: Index: library/nx/nx.tcl =================================================================== diff -u -r095e1c2332fe7332d648ce194619f15ce1f62c04 -r71eb8c412adf8946fa4930dd00f27898773ae266 --- library/nx/nx.tcl (.../nx.tcl) (revision 095e1c2332fe7332d648ce194619f15ce1f62c04) +++ library/nx/nx.tcl (.../nx.tcl) (revision 71eb8c412adf8946fa4930dd00f27898773ae266) @@ -1817,7 +1817,7 @@ unset -nocomplain :parameterSpec if {${:incremental}} { if {${:accessor} eq "none"} { set :accessor "public" } - if {![:isMultivalued]} { set :multiplicity "0..n" } + if {![:isMultivalued]} { set :multiplicity [string range ${:multiplicity} 0 0]..n } } :makeAccessor if {${:per-object} && [info exists :default]} { @@ -1855,8 +1855,7 @@ if {${:incremental}} { if {${:accessor} eq "none"} { set :accessor "public" } if {![:isMultivalued]} { - puts stderr "=== incremental adds multiplicity" - set :multiplicity "0..n" + set :multiplicity [string range ${:multiplicity} 0 0]..n } } next Index: tests/properties.test =================================================================== diff -u -r095e1c2332fe7332d648ce194619f15ce1f62c04 -r71eb8c412adf8946fa4930dd00f27898773ae266 --- tests/properties.test (.../properties.test) (revision 095e1c2332fe7332d648ce194619f15ce1f62c04) +++ tests/properties.test (.../properties.test) (revision 71eb8c412adf8946fa4930dd00f27898773ae266) @@ -703,22 +703,32 @@ nx::Object create o1 { :object property -incremental a:integer,0..n :object property -incremental b:integer,1..n + :object property -incremental c:integer,0..1 + :object property -incremental d:integer,1..1 } ? {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 object slots c] eval {set :multiplicity}} "0..n" + ? {[o1 info object slots d] 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 info variable definition [o1 info object variables c]} \ + "::o1 object property -accessor public -incremental c:integer,0..n" + ? {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 ""} {} ? {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} }