Files
wren/test/core/string/equality.wren

29 lines
1017 B
Plaintext
Raw Permalink Normal View History

System.print("" == "") // expect: true
System.print("abcd" == "abcd") // expect: true
System.print("abcd" == "d") // expect: false
System.print("e" == "abcd") // expect: false
System.print("" == "abcd") // expect: false
2013-11-05 09:57:57 -08:00
// Not equal to other types.
System.print("1" == 1) // expect: false
System.print("true" == true) // expect: false
2013-11-05 09:57:57 -08:00
System.print("" != "") // expect: false
System.print("abcd" != "abcd") // expect: false
System.print("abcd" != "d") // expect: true
System.print("e" != "abcd") // expect: true
System.print("" != "abcd") // expect: true
2013-11-05 09:57:57 -08:00
// Not equal to other types.
System.print("1" != 1) // expect: true
System.print("true" != true) // expect: true
// Non-ASCII.
System.print("vålue" == "value") // expect: false
System.print("vålue" == "vålue") // expect: true
2015-02-04 13:58:16 +01:00
2015-02-04 20:26:29 -08:00
// 8-bit clean.
System.print("a\0b\0c" == "a") // expect: false
System.print("a\0b\0c" == "abc") // expect: false
System.print("a\0b\0c" == "a\0b\0c") // expect: true