1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 22:33:57 +02:00

Refactor: rename C++ concatStringsSep -> dropEmptyInitThenConcatStringsSep

This commit is contained in:
Robert Hensing 2024-07-12 22:09:27 +02:00
parent b1effc9649
commit 1a8defd06f
33 changed files with 70 additions and 70 deletions

View file

@ -15,7 +15,7 @@ struct RewriteParams {
strRewrites.insert(from + "->" + to);
return os <<
"OriginalString: " << bar.originalString << std::endl <<
"Rewrites: " << concatStringsSep(",", strRewrites) << std::endl <<
"Rewrites: " << dropEmptyInitThenConcatStringsSep(",", strRewrites) << std::endl <<
"Expected result: " << bar.finalString;
}
};

View file

@ -227,32 +227,32 @@ namespace nix {
}
/* ----------------------------------------------------------------------------
* concatStringsSep
* dropEmptyInitThenConcatStringsSep
* --------------------------------------------------------------------------*/
TEST(concatStringsSep, buildCommaSeparatedString) {
TEST(dropEmptyInitThenConcatStringsSep, buildCommaSeparatedString) {
Strings strings;
strings.push_back("this");
strings.push_back("is");
strings.push_back("great");
ASSERT_EQ(concatStringsSep(",", strings), "this,is,great");
ASSERT_EQ(dropEmptyInitThenConcatStringsSep(",", strings), "this,is,great");
}
TEST(concatStringsSep, buildStringWithEmptySeparator) {
TEST(dropEmptyInitThenConcatStringsSep, buildStringWithEmptySeparator) {
Strings strings;
strings.push_back("this");
strings.push_back("is");
strings.push_back("great");
ASSERT_EQ(concatStringsSep("", strings), "thisisgreat");
ASSERT_EQ(dropEmptyInitThenConcatStringsSep("", strings), "thisisgreat");
}
TEST(concatStringsSep, buildSingleString) {
TEST(dropEmptyInitThenConcatStringsSep, buildSingleString) {
Strings strings;
strings.push_back("this");
ASSERT_EQ(concatStringsSep(",", strings), "this");
ASSERT_EQ(dropEmptyInitThenConcatStringsSep(",", strings), "this");
}
/* ----------------------------------------------------------------------------