Add tests for string methods that support UTF-8 already.

This commit is contained in:
Bob Nystrom
2015-01-22 15:28:54 -08:00
parent c5e67953b8
commit a92e58c804
6 changed files with 22 additions and 1 deletions
+5
View File
@@ -2,3 +2,8 @@ IO.print("abcd".indexOf("cd")) // expect: 2
IO.print("abcd".indexOf("a")) // expect: 0
IO.print("abcd".indexOf("abcde")) // expect: -1
IO.print("abab".indexOf("ab")) // expect: 0
// Non-ASCII. Note that it returns byte indices, not code points.
IO.print("søméஃthîng".indexOf("e")) // expect: -1
IO.print("søméஃthîng".indexOf("m")) // expect: 3
IO.print("søméஃthîng".indexOf("thî")) // expect: 9