17TEST(AssetCatalogPathTest, construction)
31 const std::string str_const =
"the/path";
34 std::string str_variable =
"the/path";
37 std::string long_string =
"this is a long/string/with/a/path in the middle";
41 EXPECT_EQ(from_string_ref,
"long/string/with/a/path");
65TEST(AssetCatalogPathTest, comparison_operators)
73 EXPECT_LT(empty, the_path);
74 EXPECT_LT(the_path, the_path_child);
75 EXPECT_LT(the_path, unrelated_path);
77 EXPECT_EQ(empty, empty) <<
"Identical empty instances should compare equal.";
78 EXPECT_EQ(empty,
"") <<
"Comparison to empty string should be possible.";
79 EXPECT_EQ(the_path, the_path) <<
"Identical non-empty instances should compare equal.";
80 EXPECT_EQ(the_path,
"the/path") <<
"Comparison to string should be possible.";
81 EXPECT_EQ(the_path, other_instance_same_path)
82 <<
"Different instances with equal path should compare equal.";
84 EXPECT_NE(the_path, the_path_child);
85 EXPECT_NE(the_path, unrelated_path);
86 EXPECT_NE(the_path, empty);
89 EXPECT_TRUE(the_path);
102TEST(AssetCatalogPathTest, concatenation)
108 <<
"Appending a child path should not modify the parent.";
109 EXPECT_EQ(child,
"some/родитель/ребенок");
112 EXPECT_EQ(appended_compound_path,
"some/родитель/ребенок/внук");
117 <<
"Appending to an empty path should not create an initial slash.";
120 EXPECT_EQ(parent_of_the_void,
"some/родитель")
121 <<
"Prepending to an empty path should not create a trailing slash.";
123 std::string subpath =
"child";
125 EXPECT_EQ(concatenated_with_string,
"some/родитель/child");
210TEST(AssetCatalogPathTest, iterate_components)
216 std::pair<std::string, bool> parameter_pair = std::make_pair<std::string, bool>(
217 component_name,
bool(is_last_component));
218 seen_components.
append(parameter_pair);
221 ASSERT_EQ(3, seen_components.
size());
223 EXPECT_EQ(
"путь", seen_components[0].first);
224 EXPECT_EQ(
"в", seen_components[1].first);
225 EXPECT_EQ(
"Пермь", seen_components[2].first);
227 EXPECT_FALSE(seen_components[0].second);
228 EXPECT_FALSE(seen_components[1].second);
229 EXPECT_TRUE(seen_components[2].second);