summaryrefslogtreecommitdiff
path: root/AK/Tests/TestString.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AK/Tests/TestString.cpp')
-rw-r--r--AK/Tests/TestString.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/AK/Tests/TestString.cpp b/AK/Tests/TestString.cpp
new file mode 100644
index 0000000000..fb26395a09
--- /dev/null
+++ b/AK/Tests/TestString.cpp
@@ -0,0 +1,19 @@
+#include <AK/AKString.h>
+
+int main()
+{
+ ASSERT(String().is_null());
+ ASSERT(String().is_empty());
+
+ ASSERT(!String("").is_null());
+ ASSERT(String("").is_empty());
+
+ String test_string = "ABCDEF";
+ ASSERT(!test_string.is_empty());
+ ASSERT(!test_string.is_null());
+ ASSERT(test_string.length() == 6);
+ ASSERT(test_string.length() == strlen(test_string.characters()));
+ ASSERT(!strcmp(test_string.characters(), "ABCDEF"));
+
+ return 0;
+}