diff options
author | Brody Kenrick <user.fake@server.userfake> | 2013-12-06 07:33:42 (GMT) |
---|---|---|
committer | Brody Kenrick <user.fake@server.userfake> | 2013-12-06 07:33:42 (GMT) |
commit | d7d5bea7363703c76b9787598304bfc838e893ee (patch) | |
tree | da52db861cc74e48f978dcadc81176dd63c1b86f /testdata | |
parent | a0d8cbe692a5a474a7bc284cded4a01894b25c2a (diff) |
Add specific tests for unicode len()
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/scad/misc/string-unicode.scad | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/testdata/scad/misc/string-unicode.scad b/testdata/scad/misc/string-unicode.scad index d8e3e5c..1386d63 100644 --- a/testdata/scad/misc/string-unicode.scad +++ b/testdata/scad/misc/string-unicode.scad @@ -1,3 +1,12 @@ +//Test length reporting +text_1bytes_len = "1234"; +text_2bytes_len = "ЛЛЛЛ"; +text_4bytes_len = "🂡🂱🃁🃑"; + +echo( "text_1bytes_len = ", text_1bytes_len, " len = ", len(text_1bytes_len) ); +echo( "text_2bytes_len = ", text_2bytes_len, " len = ", len(text_2bytes_len) ); +echo( "text_4bytes_len = ", text_4bytes_len, " len = ", len(text_4bytes_len) ); + //Test how well arrays of unicode string are accessed. texts_array = [ @@ -33,4 +42,3 @@ echo( "Past end of unicode only 4-byte ", text_4bytes[len(text_4bytes)] ); echo( "Past end of both 2-byte ", text_2bytes[ len(text_2bytes) * 2 ] ); echo( "Past end of both 4-byte ", text_4bytes[ len(text_4bytes) * 4 ] ); - |