Index: tests/properties.test =================================================================== diff -u -N -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 #####################################################################