summaryrefslogtreecommitdiff
path: root/tiger-compiler/tests/unit/misc/symbol/test_symbol_simple.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tiger-compiler/tests/unit/misc/symbol/test_symbol_simple.cc')
-rw-r--r--tiger-compiler/tests/unit/misc/symbol/test_symbol_simple.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/tiger-compiler/tests/unit/misc/symbol/test_symbol_simple.cc b/tiger-compiler/tests/unit/misc/symbol/test_symbol_simple.cc
new file mode 100644
index 0000000..a49ed27
--- /dev/null
+++ b/tiger-compiler/tests/unit/misc/symbol/test_symbol_simple.cc
@@ -0,0 +1,21 @@
+#include <criterion/criterion.h>
+#include <criterion/assert.h>
+#include <misc/symbol.hh>
+
+Test(test_symbol, simple)
+{
+ const misc::symbol toto1("toto");
+ const misc::symbol toto2("toto");
+ const misc::symbol titi1("titi");
+
+ cr_expect_eq(toto1, "toto");
+ cr_expect_neq(toto1, "titi");
+
+ cr_expect_eq(toto1, toto2);
+ cr_expect_neq(toto1, titi1);
+
+ std::string junk = "tata";
+ const misc::symbol tata1(junk);
+ junk = "toto";
+ cr_expect_eq(tata1, "tata");
+}