mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 12:32:21 +00:00
LibJS: Implement 'less than' for a String over code units
...Instead of code points.
This commit is contained in:
parent
d1a40b7951
commit
5495531118
Notes:
github-actions[bot]
2025-05-17 12:01:57 +00:00
Author: https://github.com/shannonbooth
Commit: 5495531118
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4740
Reviewed-by: https://github.com/stelar7
Reviewed-by: https://github.com/trflynn89
2 changed files with 22 additions and 25 deletions
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue