diff options
author | Tanzinul Islam <tanzislam@users.noreply.github.com> | 2018-03-05 02:25:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-05 02:25:59 +0000 |
commit | a7a7f51d355081a7f1e8ab295d5df5f9bb4612c8 (patch) | |
tree | c6f8f6067f957eb6d49656278f79c93353bb039c /googlemock/src/gmock-internal-utils.cc | |
parent | 4ba3803f936a2f432e60841bc9358ea2f3a951eb (diff) | |
parent | 6c73adfc03e277f55cb1e4947b3a5e6c5ff4fe46 (diff) | |
download | googletest-a7a7f51d355081a7f1e8ab295d5df5f9bb4612c8.tar.gz googletest-a7a7f51d355081a7f1e8ab295d5df5f9bb4612c8.tar.bz2 googletest-a7a7f51d355081a7f1e8ab295d5df5f9bb4612c8.zip |
Merge branch 'master' into fix_death_test_child_mingw_wer_issue1116
Diffstat (limited to 'googlemock/src/gmock-internal-utils.cc')
-rw-r--r-- | googlemock/src/gmock-internal-utils.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/googlemock/src/gmock-internal-utils.cc b/googlemock/src/gmock-internal-utils.cc index 91bf3fd9..658fa62d 100644 --- a/googlemock/src/gmock-internal-utils.cc +++ b/googlemock/src/gmock-internal-utils.cc @@ -47,6 +47,25 @@ namespace testing { namespace internal { +// Joins a vector of strings as if they are fields of a tuple; returns +// the joined string. +GTEST_API_ std::string JoinAsTuple(const Strings& fields) { + switch (fields.size()) { + case 0: + return ""; + case 1: + return fields[0]; + default: + std::string result = "(" + fields[0]; + for (size_t i = 1; i < fields.size(); i++) { + result += ", "; + result += fields[i]; + } + result += ")"; + return result; + } +} + // Converts an identifier name to a space-separated list of lower-case // words. Each maximum substring of the form [A-Za-z][a-z]*|\d+ is // treated as one word. For example, both "FooBar123" and |