diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2011-11-21 23:35:13 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2011-11-21 23:35:13 (GMT) |
commit | 4843022bf4755d7fafe58faee430a6f62f51ca8f (patch) | |
tree | 34ce84fbfdbfb720b4aae4ae575f296341bbccab /testdata | |
parent | e31bb0f60312e692f5ef57fd3823e413cc8a669c (diff) | |
parent | b211fe5158160910c73397bc401fb846c45a7295 (diff) |
Merge remote branch 'upstream/master' into cakebaby
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/scad/misc/string-indexing.scad | 17 |
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 |