diff options
Diffstat (limited to 'src/generic/intern-pool_test.cpp')
-rw-r--r-- | src/generic/intern-pool_test.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/generic/intern-pool_test.cpp b/src/generic/intern-pool_test.cpp index b72ab04..c91be91 100644 --- a/src/generic/intern-pool_test.cpp +++ b/src/generic/intern-pool_test.cpp @@ -1,5 +1,5 @@ #include "intern-pool.hpp" -// intern-pool.hpp - Testsuite for cached integer/string lookups. +// intern-pool_test.cpp - Testsuite for cached integer/string lookups. // // Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com> // @@ -20,21 +20,25 @@ #include <gtest/gtest.h> -#include "../strings/base.hpp" +#include "../strings/literal.hpp" #include "../poison.hpp" + +namespace tmwa +{ TEST(InternPool, whydoesthisalwaysneedasecondname) { InternPool p; EXPECT_EQ(0, p.size()); - EXPECT_EQ(0, p.intern("hello")); - EXPECT_EQ(0, p.intern("hello")); + EXPECT_EQ(0, p.intern("hello"_s)); + EXPECT_EQ(0, p.intern("hello"_s)); EXPECT_EQ(1, p.size()); - EXPECT_EQ(1, p.intern("world")); - EXPECT_EQ(0, p.intern("hello")); - EXPECT_EQ(1, p.intern("world")); + EXPECT_EQ(1, p.intern("world"_s)); + EXPECT_EQ(0, p.intern("hello"_s)); + EXPECT_EQ(1, p.intern("world"_s)); EXPECT_EQ(2, p.size()); - EXPECT_EQ("hello", p.outtern(0)); - EXPECT_EQ("world", p.outtern(1)); + EXPECT_EQ("hello"_s, p.outtern(0)); + EXPECT_EQ("world"_s, p.outtern(1)); } +} // namespace tmwa |