summaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'testdata')
-rw-r--r--testdata/scad/misc/lookup-tests.scad17
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));
+}
contact: Jan Huwald // Impressum