From c812c92d1a1835f0bda783e709481188c8d92225 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 15 Mar 2014 19:34:59 -0700 Subject: Clean up header organization --- src/generic/intern-pool_test.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/generic/intern-pool_test.cpp (limited to 'src/generic/intern-pool_test.cpp') diff --git a/src/generic/intern-pool_test.cpp b/src/generic/intern-pool_test.cpp new file mode 100644 index 0000000..bf17b67 --- /dev/null +++ b/src/generic/intern-pool_test.cpp @@ -0,0 +1,20 @@ +#include "intern-pool.hpp" + +#include + +#include "../strings/base.hpp" + +TEST(InternPool, whydoesthisalwaysneedasecondname) +{ + InternPool p; + EXPECT_EQ(0, p.size()); + EXPECT_EQ(0, p.intern("hello")); + EXPECT_EQ(0, p.intern("hello")); + 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(2, p.size()); + EXPECT_EQ("hello", p.outtern(0)); + EXPECT_EQ("world", p.outtern(1)); +} -- cgit v1.2.3-70-g09d2