#include "../c++/test/suite.hpp" #include "../c++/id.hpp" #include "../c++/string_literal.hpp" namespace { SAW_TEST("ID functionality") { using namespace saw; struct foo {}; id a{1}; id b{1}; id c{2}; /** * The following doesn't compile, so it's commented out as an example */ /** * struct bar {}; * * id d{1}; * * SAW_EXPECT(a == d, "Shouldn't compile"); */ SAW_EXPECT(a == b, "Should be equal"); SAW_EXPECT(a != c, "Shouldn't be equal"); SAW_EXPECT(b != c, "Shouldn't be equal"); SAW_EXPECT(a.get_value() == 1, "Lost original value"); } SAW_TEST("String Literal Append"){ using namespace saw; constexpr string_literal a = "foo"; constexpr string_literal b = "bar"; constexpr string_literal c = a+b; SAW_EXPECT(c == "foobar", "CT String sum is not \"foobar\""); } }