summaryrefslogtreecommitdiff
path: root/src/mmo/extract_test.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-04-14 11:02:47 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-04-14 11:32:36 -0700
commit56e149a51562b9d2620bc9037a81735c29ea95af (patch)
tree3a4bd218f69c5cbfec0dd8dcada34413c0ddc715 /src/mmo/extract_test.cpp
parent1a1bfc8fd8a3613bf7d3c320dcaff29a9402f50c (diff)
downloadtmwa-56e149a51562b9d2620bc9037a81735c29ea95af.tar.gz
tmwa-56e149a51562b9d2620bc9037a81735c29ea95af.tar.bz2
tmwa-56e149a51562b9d2620bc9037a81735c29ea95af.tar.xz
tmwa-56e149a51562b9d2620bc9037a81735c29ea95af.zip
Ditch gcc 4.6 support
Diffstat (limited to 'src/mmo/extract_test.cpp')
-rw-r--r--src/mmo/extract_test.cpp378
1 files changed, 189 insertions, 189 deletions
diff --git a/src/mmo/extract_test.cpp b/src/mmo/extract_test.cpp
index 60ab49e..c405de1 100644
--- a/src/mmo/extract_test.cpp
+++ b/src/mmo/extract_test.cpp
@@ -28,154 +28,154 @@ TEST(extract, record_int)
{
int x, y, z;
x = y = z = 0;
- EXPECT_FALSE(extract("1 2 3 4 ", record<' '>(&x, &y, &z)));
+ EXPECT_FALSE(extract("1 2 3 4 "_s, record<' '>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(3, z);
x = y = z = 0;
- EXPECT_FALSE(extract("1 2 3 4", record<' '>(&x, &y, &z)));
+ EXPECT_FALSE(extract("1 2 3 4"_s, record<' '>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(3, z);
x = y = z = 0;
- EXPECT_TRUE(extract("1 2 3 ", record<' '>(&x, &y, &z)));
+ EXPECT_TRUE(extract("1 2 3 "_s, record<' '>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(3, z);
x = y = z = 0;
- EXPECT_TRUE(extract("1 2 3", record<' '>(&x, &y, &z)));
+ EXPECT_TRUE(extract("1 2 3"_s, record<' '>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(3, z);
x = y = z = 0;
- EXPECT_FALSE(extract("1 2 ", record<' '>(&x, &y, &z)));
+ EXPECT_FALSE(extract("1 2 "_s, record<' '>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract("1 2", record<' '>(&x, &y, &z)));
+ EXPECT_FALSE(extract("1 2"_s, record<' '>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract("1 ", record<' '>(&x, &y, &z)));
+ EXPECT_FALSE(extract("1 "_s, record<' '>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(0, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract("1", record<' '>(&x, &y, &z)));
+ EXPECT_FALSE(extract("1"_s, record<' '>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(0, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract(" ", record<' '>(&x, &y, &z)));
+ EXPECT_FALSE(extract(" "_s, record<' '>(&x, &y, &z)));
EXPECT_EQ(0, x);
EXPECT_EQ(0, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract("", record<' '>(&x, &y, &z)));
+ EXPECT_FALSE(extract(""_s, record<' '>(&x, &y, &z)));
EXPECT_EQ(0, x);
EXPECT_EQ(0, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract("1 2 3 4 ", record<' ', 2>(&x, &y, &z)));
+ EXPECT_FALSE(extract("1 2 3 4 "_s, record<' ', 2>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(3, z);
x = y = z = 0;
- EXPECT_FALSE(extract("1 2 3 4", record<' ', 2>(&x, &y, &z)));
+ EXPECT_FALSE(extract("1 2 3 4"_s, record<' ', 2>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(3, z);
x = y = z = 0;
- EXPECT_TRUE(extract("1 2 3 ", record<' ', 2>(&x, &y, &z)));
+ EXPECT_TRUE(extract("1 2 3 "_s, record<' ', 2>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(3, z);
x = y = z = 0;
- EXPECT_TRUE(extract("1 2 3", record<' ', 2>(&x, &y, &z)));
+ EXPECT_TRUE(extract("1 2 3"_s, record<' ', 2>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(3, z);
x = y = z = 0;
- EXPECT_TRUE(extract("1 2 ", record<' ', 2>(&x, &y, &z)));
+ EXPECT_TRUE(extract("1 2 "_s, record<' ', 2>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_TRUE(extract("1 2", record<' ', 2>(&x, &y, &z)));
+ EXPECT_TRUE(extract("1 2"_s, record<' ', 2>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract("1 ", record<' ', 2>(&x, &y, &z)));
+ EXPECT_FALSE(extract("1 "_s, record<' ', 2>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(0, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract("1", record<' ', 2>(&x, &y, &z)));
+ EXPECT_FALSE(extract("1"_s, record<' ', 2>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(0, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract(" ", record<' ', 2>(&x, &y, &z)));
+ EXPECT_FALSE(extract(" "_s, record<' ', 2>(&x, &y, &z)));
EXPECT_EQ(0, x);
EXPECT_EQ(0, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract("", record<' ', 2>(&x, &y, &z)));
+ EXPECT_FALSE(extract(""_s, record<' ', 2>(&x, &y, &z)));
EXPECT_EQ(0, x);
EXPECT_EQ(0, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract("1 2 3 4 ", record<' ', 1>(&x, &y, &z)));
+ EXPECT_FALSE(extract("1 2 3 4 "_s, record<' ', 1>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(3, z);
x = y = z = 0;
- EXPECT_FALSE(extract("1 2 3 4", record<' ', 1>(&x, &y, &z)));
+ EXPECT_FALSE(extract("1 2 3 4"_s, record<' ', 1>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(3, z);
x = y = z = 0;
- EXPECT_TRUE(extract("1 2 3 ", record<' ', 1>(&x, &y, &z)));
+ EXPECT_TRUE(extract("1 2 3 "_s, record<' ', 1>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(3, z);
x = y = z = 0;
- EXPECT_TRUE(extract("1 2 3", record<' ', 1>(&x, &y, &z)));
+ EXPECT_TRUE(extract("1 2 3"_s, record<' ', 1>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(3, z);
x = y = z = 0;
- EXPECT_TRUE(extract("1 2 ", record<' ', 1>(&x, &y, &z)));
+ EXPECT_TRUE(extract("1 2 "_s, record<' ', 1>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_TRUE(extract("1 2", record<' ', 1>(&x, &y, &z)));
+ EXPECT_TRUE(extract("1 2"_s, record<' ', 1>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(2, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_TRUE(extract("1 ", record<' ', 1>(&x, &y, &z)));
+ EXPECT_TRUE(extract("1 "_s, record<' ', 1>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(0, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_TRUE(extract("1", record<' ', 1>(&x, &y, &z)));
+ EXPECT_TRUE(extract("1"_s, record<' ', 1>(&x, &y, &z)));
EXPECT_EQ(1, x);
EXPECT_EQ(0, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract(" ", record<' ', 1>(&x, &y, &z)));
+ EXPECT_FALSE(extract(" "_s, record<' ', 1>(&x, &y, &z)));
EXPECT_EQ(0, x);
EXPECT_EQ(0, y);
EXPECT_EQ(0, z);
x = y = z = 0;
- EXPECT_FALSE(extract("", record<' ', 1>(&x, &y, &z)));
+ EXPECT_FALSE(extract(""_s, record<' ', 1>(&x, &y, &z)));
EXPECT_EQ(0, x);
EXPECT_EQ(0, y);
EXPECT_EQ(0, z);
@@ -185,170 +185,170 @@ TEST(extract, record_int)
TEST(extract, record_str)
{
XString x, y, z;
- x = y = z = "";
- EXPECT_FALSE(extract("1 2 3 4 ", record<' '>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("3", z);
- x = y = z = "";
- EXPECT_FALSE(extract("1 2 3 4", record<' '>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("3", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 2 3 ", record<' '>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("3", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 2 3", record<' '>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("3", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 2 ", record<' '>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_FALSE(extract("1 2", record<' '>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_FALSE(extract("1 ", record<' '>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_FALSE(extract("1", record<' '>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_FALSE(extract(" ", record<' '>(&x, &y, &z)));
- EXPECT_EQ("", x);
- EXPECT_EQ("", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_FALSE(extract("", record<' '>(&x, &y, &z)));
- EXPECT_EQ("", x);
- EXPECT_EQ("", y);
- EXPECT_EQ("", z);
- x = y = z = "";
+ x = y = z = ""_s;
+ EXPECT_FALSE(extract("1 2 3 4 "_s, record<' '>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ("3"_s, z);
+ x = y = z = ""_s;
+ EXPECT_FALSE(extract("1 2 3 4"_s, record<' '>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ("3"_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 2 3 "_s, record<' '>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ("3"_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 2 3"_s, record<' '>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ("3"_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 2 "_s, record<' '>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_FALSE(extract("1 2"_s, record<' '>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_FALSE(extract("1 "_s, record<' '>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ(""_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_FALSE(extract("1"_s, record<' '>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ(""_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_FALSE(extract(" "_s, record<' '>(&x, &y, &z)));
+ EXPECT_EQ(""_s, x);
+ EXPECT_EQ(""_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_FALSE(extract(""_s, record<' '>(&x, &y, &z)));
+ EXPECT_EQ(""_s, x);
+ EXPECT_EQ(""_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
- EXPECT_FALSE(extract("1 2 3 4 ", record<' ', 2>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("3", z);
- x = y = z = "";
- EXPECT_FALSE(extract("1 2 3 4", record<' ', 2>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("3", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 2 3 ", record<' ', 2>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("3", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 2 3", record<' ', 2>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("3", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 2 ", record<' ', 2>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 2", record<' ', 2>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 ", record<' ', 2>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_FALSE(extract("1", record<' ', 2>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_TRUE(extract(" ", record<' ', 2>(&x, &y, &z)));
- EXPECT_EQ("", x);
- EXPECT_EQ("", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_FALSE(extract("", record<' ', 2>(&x, &y, &z)));
- EXPECT_EQ("", x);
- EXPECT_EQ("", y);
- EXPECT_EQ("", z);
- x = y = z = "";
+ EXPECT_FALSE(extract("1 2 3 4 "_s, record<' ', 2>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ("3"_s, z);
+ x = y = z = ""_s;
+ EXPECT_FALSE(extract("1 2 3 4"_s, record<' ', 2>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ("3"_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 2 3 "_s, record<' ', 2>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ("3"_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 2 3"_s, record<' ', 2>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ("3"_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 2 "_s, record<' ', 2>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 2"_s, record<' ', 2>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 "_s, record<' ', 2>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ(""_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_FALSE(extract("1"_s, record<' ', 2>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ(""_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract(" "_s, record<' ', 2>(&x, &y, &z)));
+ EXPECT_EQ(""_s, x);
+ EXPECT_EQ(""_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_FALSE(extract(""_s, record<' ', 2>(&x, &y, &z)));
+ EXPECT_EQ(""_s, x);
+ EXPECT_EQ(""_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
- EXPECT_FALSE(extract("1 2 3 4 ", record<' ', 1>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("3", z);
- x = y = z = "";
- EXPECT_FALSE(extract("1 2 3 4", record<' ', 1>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("3", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 2 3 ", record<' ', 1>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("3", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 2 3", record<' ', 1>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("3", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 2 ", record<' ', 1>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 2", record<' ', 1>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("2", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1 ", record<' ', 1>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_TRUE(extract("1", record<' ', 1>(&x, &y, &z)));
- EXPECT_EQ("1", x);
- EXPECT_EQ("", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_TRUE(extract(" ", record<' ', 1>(&x, &y, &z)));
- EXPECT_EQ("", x);
- EXPECT_EQ("", y);
- EXPECT_EQ("", z);
- x = y = z = "";
- EXPECT_TRUE(extract("", record<' ', 1>(&x, &y, &z)));
- EXPECT_EQ("", x);
- EXPECT_EQ("", y);
- EXPECT_EQ("", z);
- x = y = z = "";
+ EXPECT_FALSE(extract("1 2 3 4 "_s, record<' ', 1>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ("3"_s, z);
+ x = y = z = ""_s;
+ EXPECT_FALSE(extract("1 2 3 4"_s, record<' ', 1>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ("3"_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 2 3 "_s, record<' ', 1>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ("3"_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 2 3"_s, record<' ', 1>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ("3"_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 2 "_s, record<' ', 1>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 2"_s, record<' ', 1>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ("2"_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1 "_s, record<' ', 1>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ(""_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract("1"_s, record<' ', 1>(&x, &y, &z)));
+ EXPECT_EQ("1"_s, x);
+ EXPECT_EQ(""_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract(" "_s, record<' ', 1>(&x, &y, &z)));
+ EXPECT_EQ(""_s, x);
+ EXPECT_EQ(""_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
+ EXPECT_TRUE(extract(""_s, record<' ', 1>(&x, &y, &z)));
+ EXPECT_EQ(""_s, x);
+ EXPECT_EQ(""_s, y);
+ EXPECT_EQ(""_s, z);
+ x = y = z = ""_s;
}
TEST(extract, mapname)
{
MapName map;
- EXPECT_TRUE(extract("abc", &map));
- EXPECT_EQ(map, "abc");
- EXPECT_TRUE(extract("abc.gat", &map));
- EXPECT_EQ(map, "abc");
- EXPECT_TRUE(extract("abcdefghijklmno", &map));
- EXPECT_EQ(map, "abcdefghijklmno");
- EXPECT_TRUE(extract("abcdefghijklmno.gat", &map));
- EXPECT_EQ(map, "abcdefghijklmno");
+ EXPECT_TRUE(extract("abc"_s, &map));
+ EXPECT_EQ(map, "abc"_s);
+ EXPECT_TRUE(extract("abc.gat"_s, &map));
+ EXPECT_EQ(map, "abc"_s);
+ EXPECT_TRUE(extract("abcdefghijklmno"_s, &map));
+ EXPECT_EQ(map, "abcdefghijklmno"_s);
+ EXPECT_TRUE(extract("abcdefghijklmno.gat"_s, &map));
+ EXPECT_EQ(map, "abcdefghijklmno"_s);
}