Go to the source code of this file.
Definition at line 21 of file LogNameTest.cpp.
References folly::LogName::canonicalize(), and EXPECT_EQ.
22 EXPECT_EQ(
"", LogName::canonicalize(
"."));
23 EXPECT_EQ(
"", LogName::canonicalize(
"..."));
24 EXPECT_EQ(
"", LogName::canonicalize(
"/"));
25 EXPECT_EQ(
"", LogName::canonicalize(
"\\"));
26 EXPECT_EQ(
"", LogName::canonicalize(
".//..\\\\./"));
27 EXPECT_EQ(
"foo.bar", LogName::canonicalize(
".foo..bar."));
28 EXPECT_EQ(
"a.b.c", LogName::canonicalize(
"a.b.c"));
29 EXPECT_EQ(
"a.b.c", LogName::canonicalize(
"a/b/c"));
30 EXPECT_EQ(
"a.b.c", LogName::canonicalize(
"a/b/c/"));
31 EXPECT_EQ(
"a.b.c", LogName::canonicalize(
"a..b.c..."));
32 EXPECT_EQ(
"a.b.c", LogName::canonicalize(
"....a.b.c"));
33 EXPECT_EQ(
"a.b.c", LogName::canonicalize(
"a.b.c...."));
34 EXPECT_EQ(
"a.b.c", LogName::canonicalize(
"////a.b.c"));
35 EXPECT_EQ(
"a.b.c", LogName::canonicalize(
"a.b.c////"));
36 EXPECT_EQ(
"a.b.c", LogName::canonicalize(
"/a.b.//.c/"));
#define EXPECT_EQ(val1, val2)
Definition at line 39 of file LogNameTest.cpp.
References EXPECT_EQ, and folly::LogName::getParent().
41 EXPECT_EQ(
"", LogName::getParent(
".foo"));
42 EXPECT_EQ(
"foo", LogName::getParent(
"foo.bar"));
43 EXPECT_EQ(
"foo", LogName::getParent(
"foo/bar"));
44 EXPECT_EQ(
"foo", LogName::getParent(
"foo\\bar"));
45 EXPECT_EQ(
"foo", LogName::getParent(
"foo\\bar/"));
46 EXPECT_EQ(
"foo", LogName::getParent(
"foo\\bar\\"));
47 EXPECT_EQ(
"foo..bar", LogName::getParent(
"foo..bar..test"));
48 EXPECT_EQ(
"..foo..bar", LogName::getParent(
"..foo..bar..test.."));
#define EXPECT_EQ(val1, val2)
Definition at line 51 of file LogNameTest.cpp.
References EXPECT_EQ, EXPECT_NE, and folly::LogName::hash().
52 EXPECT_EQ(LogName::hash(
"foo"), LogName::hash(
"foo."));
53 EXPECT_EQ(LogName::hash(
".foo..bar"), LogName::hash(
"foo.bar..."));
54 EXPECT_EQ(LogName::hash(
"a.b.c..d."), LogName::hash(
"..a.b.c.d."));
55 EXPECT_EQ(LogName::hash(
"a.b.c.d"), LogName::hash(
"/a/b/c/d/"));
56 EXPECT_EQ(LogName::hash(
"a.b.c.d"), LogName::hash(
"a\\b\\c/d/"));
57 EXPECT_EQ(LogName::hash(
""), LogName::hash(
"."));
58 EXPECT_EQ(LogName::hash(
""), LogName::hash(
"//"));
59 EXPECT_EQ(LogName::hash(
""), LogName::hash(
"\\"));
60 EXPECT_EQ(LogName::hash(
""), LogName::hash(
"...."));
65 EXPECT_NE(LogName::hash(
"foo"), LogName::hash(
"bar"));
66 EXPECT_NE(LogName::hash(
"a.b.c"), LogName::hash(
"abc"));
#define EXPECT_EQ(val1, val2)
#define EXPECT_NE(val1, val2)
Definition at line 69 of file LogNameTest.cpp.
References folly::LogName::cmp(), EXPECT_EQ, EXPECT_GT, and EXPECT_LT.
70 EXPECT_EQ(0, LogName::cmp(
"foo",
"foo."));
71 EXPECT_EQ(0, LogName::cmp(
"foo",
"foo/"));
72 EXPECT_EQ(0, LogName::cmp(
".foo..bar",
"foo.bar..."));
73 EXPECT_EQ(0, LogName::cmp(
".foo.bar",
"foo...bar..."));
74 EXPECT_EQ(0, LogName::cmp(
"a.b.c..d.",
"..a.b.c.d."));
75 EXPECT_EQ(0, LogName::cmp(
"a.b.c..d.",
"\\/a.b/c/d."));
80 EXPECT_LT(LogName::cmp(
"a.b.c",
"abc"), 0);
81 EXPECT_LT(LogName::cmp(
"a...b.c",
"a.bc"), 0);
82 EXPECT_GT(LogName::cmp(
"a...b.z",
"a.b.c"), 0);
83 EXPECT_LT(LogName::cmp(
".foo.bar",
"foobar..."), 0);
84 EXPECT_GT(LogName::cmp(
"foobar",
".foo...bar"), 0);
#define EXPECT_EQ(val1, val2)
#define EXPECT_LT(val1, val2)
#define EXPECT_GT(val1, val2)