diff options
Diffstat (limited to 'testdata/scad/misc/value-reassignment-tests2.scad')
-rw-r--r-- | testdata/scad/misc/value-reassignment-tests2.scad | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/testdata/scad/misc/value-reassignment-tests2.scad b/testdata/scad/misc/value-reassignment-tests2.scad index 9d7cf50..29a2fb7 100644 --- a/testdata/scad/misc/value-reassignment-tests2.scad +++ b/testdata/scad/misc/value-reassignment-tests2.scad @@ -5,5 +5,12 @@ myval = 2; i = myval; myval = 3; -echo(myval, i); // Should output 3, 2 +echo(myval, i); // Should output 3, 3 + +// NB! This feels wrong, but it's a simulation of what happens +// when overriding a variable on the cmd-line: openscad -Dmyval=3 myfile.scad +// Since the intention is to override a top-level variable, the evaluation of the +// new expression must be done in the same place as the old. +// This is currently solved by appending the text given to the -D parameter to the end +// of the main file. |