From 369e3d71aa79783d95166739cfa93a480defe6ea Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sat, 2 Nov 2024 14:44:25 +0100 Subject: more cleanup + add give command to test things --- test/CMakeLists.txt | 3 +++ test/string.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 test/CMakeLists.txt create mode 100644 test/string.cpp (limited to 'test') 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 + +#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); +} + + + -- cgit v1.2.3