diff options
author | Marius Kintel <marius@kintel.net> | 2013-05-09 15:28:05 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-05-09 15:28:05 (GMT) |
commit | 3780677def0ab71375f976efe0235c840dd02de2 (patch) | |
tree | 5b1c9b7730ab22e53c39e46f2a8131456d95dc81 /testdata | |
parent | 715d539f4ea1a37833ab2429262593aee57304fe (diff) |
Added testcase for #322
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/scad/misc/lookup-tests.scad | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testdata/scad/misc/lookup-tests.scad b/testdata/scad/misc/lookup-tests.scad new file mode 100644 index 0000000..c03ec95 --- /dev/null +++ b/testdata/scad/misc/lookup-tests.scad @@ -0,0 +1,17 @@ +echo(lookup(undef, undef)); +echo(lookup(undef, [undef])); +echo(lookup(undef, [[undef]])); +echo(lookup(undef, [[undef, undef]])); +echo(lookup(0, [[0, 0]])); +echo(lookup(0.5, [[0, 0], + [1, 1]])); + +table = [[-1, -5], + [-10, -55], + [0, 0], + [1, 3], + [10, 333]]; +indices = [-20,-10,-9.9, -0.5, 0, 0.3, 1.1, 10, 10.1]; +for (i=[0:len(indices)-1]) { + echo(lookup(indices[i], table)); +} |