mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
LibJS: Implement 'less than' for a String over code units
...Instead of code points.
This commit is contained in:
Notes:
github-actions[bot]
2025-05-17 12:01:57 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/5495531118a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4740 Reviewed-by: https://github.com/stelar7 Reviewed-by: https://github.com/trflynn89
@@ -40,3 +40,18 @@ test("properties", () => {
|
||||
expect(Object.getOwnPropertyNames("abc")).toEqual(["0", "1", "2", "length"]);
|
||||
expect(Object.getOwnPropertyNames("😀")).toEqual(["0", "1", "length"]);
|
||||
});
|
||||
|
||||
test("less than", () => {
|
||||
expect("a" < "").toBe(false);
|
||||
expect("a" < "b").toBe(true);
|
||||
expect("a" < "aa").toBe(true);
|
||||
expect("aa" < "a").toBe(false);
|
||||
expect("abc" < "abd").toBe(true);
|
||||
expect("abc" < "abcd").toBe(true);
|
||||
expect("😀" < "😁").toBe(true);
|
||||
expect("" < "😁").toBe(true);
|
||||
expect("😁" < "").toBe(false);
|
||||
expect("a" < "A").toBe(false);
|
||||
expect("a" < "a").toBe(false);
|
||||
expect("~" < "😀").toBe(false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user