aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-02 14:44:25 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-02 14:44:25 +0100
commit369e3d71aa79783d95166739cfa93a480defe6ea (patch)
treecc4e590da6d98fc891ce3488cc150ffa10173520 /test
parent815ec66a68c01dc4a8f0c5ec6c9193a71e7547e2 (diff)
more cleanup + add give command to test things
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);
+}
+
+
+