1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

AKString: add missing comparison operators

And some trivial tests.
This commit is contained in:
Lawrence Manning 2019-07-11 11:58:27 +01:00 committed by Andreas Kling
parent 26956db5ac
commit c3ecf753b2
2 changed files with 31 additions and 0 deletions

9
AK/Tests/TestString.cpp Normal file → Executable file
View file

@ -25,6 +25,15 @@ int main()
EXPECT(test_string != "ABCDE");
EXPECT(test_string != "ABCDEFG");
EXPECT("a" < String("b"));
EXPECT(!("a" > String("b")));
EXPECT("b" > String("a"));
EXPECT(!("b" < String("b")));
EXPECT("a" >= String("a"));
EXPECT(!("a" >= String("b")));
EXPECT("a" <= String("a"));
EXPECT(!("b" <= String("a")));
EXPECT_EQ(test_string[0], 'A');
EXPECT_EQ(test_string[1], 'B');