Преглед на файлове

Add string comparison unit tests (#8349)

Aurel преди 6 години
родител
ревизия
7568079a04
променени са 1 файла, в които са добавени 22 реда и са изтрити 1 реда
  1. 22 1
      tests/unit/src/unitstd/String.unit.hx

+ 22 - 1
tests/unit/src/unitstd/String.unit.hx

@@ -196,4 +196,25 @@ testCodes([for(c in iterator) c]);
 testKeyCodes([for(i => c in s) [i, c]]);
 testKeyCodes([for(i => c in (s:KeyValueIterable<Int,Int>)) [i, c]]);
 var iterator:KeyValueIterator<Int,Int> = (s:Dynamic).keyValueIterator();
-testKeyCodes([for(i => c in iterator) [i, c]]);
+testKeyCodes([for(i => c in iterator) [i, c]]);
+
+// string comparison (see #8332)
+("a" < "b") == true;
+("a" <= "b") == true;
+("a" > "b") == false;
+("a" >= "b") == false;
+
+#if (target.unicode)
+("𠜎zя" > "abя") == true;
+("𠜎zя" >= "abя") == true;
+("𠜎zя" < "abя") == false;
+("𠜎zя" <= "abя") == false;
+
+#if (target.utf16)
+// since U+10002 in UTF16 is D800 DC02
+("\u{FF61}" < "\u{10002}") == false;
+#else
+("\u{FF61}" < "\u{10002}") == true;
+#end
+
+#end