summaryrefslogtreecommitdiff
path: root/AK/Tests/TestString.cpp
diff options
context:
space:
mode:
authorLawrence Manning <lawrence@aslak.net>2019-07-11 11:58:27 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-07-11 14:13:30 +0200
commitc3ecf753b2da6127b14f2e4933cb004167ced2f8 (patch)
tree401394359bfa283e8eedebc80d7abb72103cefa7 /AK/Tests/TestString.cpp
parent26956db5ac969983a1f9e3b8f26c8c794c703e1f (diff)
downloadserenity-c3ecf753b2da6127b14f2e4933cb004167ced2f8.zip
AKString: add missing comparison operators
And some trivial tests.
Diffstat (limited to 'AK/Tests/TestString.cpp')
-rwxr-xr-x[-rw-r--r--]AK/Tests/TestString.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/AK/Tests/TestString.cpp b/AK/Tests/TestString.cpp
index 851971a77e..808d0904be 100644..100755
--- a/AK/Tests/TestString.cpp
+++ b/AK/Tests/TestString.cpp
@@ -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');