summaryrefslogtreecommitdiff
path: root/testdata/scad/misc/string-indexing.scad
diff options
context:
space:
mode:
authorBrad Pitcher <bradpitcher@gmail.com>2011-11-13 20:15:28 (GMT)
committerBrad Pitcher <bradpitcher@gmail.com>2011-11-13 20:15:28 (GMT)
commitaf2d4223df8640dea8a7d5a79db1d89aab392269 (patch)
tree7a66364294a6d2f3b0a788e4e586c9e41f471e05 /testdata/scad/misc/string-indexing.scad
parentdcf4b83306d0ebf50a43aedba4f2be1c169a7152 (diff)
string indexing tests
Diffstat (limited to 'testdata/scad/misc/string-indexing.scad')
-rw-r--r--testdata/scad/misc/string-indexing.scad17
1 files changed, 17 insertions, 0 deletions
diff --git a/testdata/scad/misc/string-indexing.scad b/testdata/scad/misc/string-indexing.scad
new file mode 100644
index 0000000..3dc31c9
--- /dev/null
+++ b/testdata/scad/misc/string-indexing.scad
@@ -0,0 +1,17 @@
+test = "test";
+
+// Correct usage cases
+for(i = [0:len(test)-1]) {
+ echo(test[i]);
+}
+
+// Out of bounds
+echo(test[-1]);
+echo(test[len(test)]);
+
+// Invalid index type
+echo(test["test"]);
+echo(test[true]);
+echo(test[false]);
+echo(test[[0]]);
+echo(test[1.7]); \ No newline at end of file
contact: Jan Huwald // Impressum