Files
wren/test/core/string/ends_with.wren
T

16 lines
652 B
Plaintext
Raw Normal View History

2015-09-15 07:46:09 -07:00
System.print("abcd".endsWith("cd")) // expect: true
System.print("abcd".endsWith("abcde")) // expect: false
System.print("abcd".endsWith("abcd")) // expect: true
System.print("abcd".endsWith("f")) // expect: false
System.print("abcd".endsWith("")) // expect: true
// Non-ASCII.
2015-09-15 07:46:09 -07:00
System.print("søméthîng".endsWith("thîng")) // expect: true
System.print("søméthîng".endsWith("thing")) // expect: false
2015-02-04 13:58:16 +01:00
2015-02-04 20:26:29 -08:00
// 8-bit clean.
2015-09-15 07:46:09 -07:00
System.print("a\0b\0c".endsWith("\0")) // expect: false
System.print("a\0b\0c".endsWith("c")) // expect: true
System.print("a\0b\0c".endsWith("\0c")) // expect: true
System.print("a\0b\0c".endsWith("\0b")) // expect: false