summaryrefslogtreecommitdiff
path: root/tiger-compiler/tests/unit/misc/symbol/test_symbol_simple.cc
blob: a49ed27550812c77de8ef7ad664a0d7cc6702e46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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");
}