aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt3
-rw-r--r--test/string.cpp24
2 files changed, 27 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..bba1d07
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,3 @@
+target_sources(test_main PUBLIC
+ string.cpp
+)
diff --git a/test/string.cpp b/test/string.cpp
new file mode 100644
index 0000000..dc329e3
--- /dev/null
+++ b/test/string.cpp
@@ -0,0 +1,24 @@
+#include <gtest/gtest.h>
+
+#include "backend/String.h"
+
+TEST(StringTest, OperatorEqual) {
+ String a = "foo";
+ String b = "foo";
+ ASSERT_TRUE(a == b);
+
+ b = "bar";
+ ASSERT_FALSE(a == b);
+}
+
+TEST(StringTest, OperatorNotEqual) {
+ String a = "foo";
+ String b = "foo";
+ ASSERT_FALSE(a != b);
+
+ b = "bar";
+ ASSERT_TRUE(a != b);
+}
+
+
+