Skip to content

Commit a08bb5a

Browse files
committed
minor improvements to tests
1 parent ef75fc0 commit a08bb5a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/unlib_test.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,21 @@ inline void remove_substr(std::string& name, const std::string& substr) {
1515
for(std::string::size_type idx = name.find(substr); idx != std::string::npos; idx = name.find(substr))
1616
name.erase(idx, substr.size());
1717
}
18+
inline void replace_substr(std::string& name, const std::string& substr, const std::string& replacement) {
19+
for(std::string::size_type idx = name.find(substr); idx != std::string::npos; idx = name.find(substr))
20+
name.replace(idx, substr.size(), replacement);
21+
}
1822
inline void remove_prefix(std::string& name, std::string prefix) {
1923
remove_substr(name, prefix + "::");
2024
}
2125
inline std::string filter_type_name(std::string name) {
2226
remove_prefix(name, "unlib");
23-
remove_prefix(name, "std");
24-
remove_substr(name, "ll");
27+
remove_prefix(name, "std" );
28+
remove_substr(name, "ll" );
2529
remove_substr(name, "ratio");
30+
31+
replace_substr(name, "> >", ">>");
32+
2633
return name;
2734
}
2835

0 commit comments

Comments
 (0)