summaryrefslogtreecommitdiff
path: root/testdata/scad/misc/string-indexing.scad
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2011-11-21 23:35:13 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2011-11-21 23:35:13 (GMT)
commit4843022bf4755d7fafe58faee430a6f62f51ca8f (patch)
tree34ce84fbfdbfb720b4aae4ae575f296341bbccab /testdata/scad/misc/string-indexing.scad
parente31bb0f60312e692f5ef57fd3823e413cc8a669c (diff)
parentb211fe5158160910c73397bc401fb846c45a7295 (diff)
Merge remote branch 'upstream/master' into cakebaby
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