summaryrefslogtreecommitdiff
path: root/test/utils.h
diff options
context:
space:
mode:
authorOleg Morozenkov <m@oleg.rocks>2018-07-26 00:03:15 +0300
committerOleg Morozenkov <m@oleg.rocks>2018-07-26 00:03:15 +0300
commit2234450b81e3451a3e14686e80e13e66cf6d2a4a (patch)
tree1eeda88af36566425621c34092df9e63b5749037 /test/utils.h
parent399eb75d2af1e641fd80b25d1729ef250a66314a (diff)
Test on old ubuntu
Diffstat (limited to 'test/utils.h')
-rw-r--r--test/utils.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/utils.h b/test/utils.h
index e0db42b..9225b84 100644
--- a/test/utils.h
+++ b/test/utils.h
@@ -98,17 +98,21 @@ inline std::string diffS(const std::string& test, const std::string& expected) {
v2.push_back(s2);
}
} while (r1 || r2);
- return diff(v1, v2, [](const std::string& item) {
- return item;
- });
+
+ std::string (*toStringFunc)(const std::string&) =
+ [](const std::string& item) -> std::string { return item; };
+
+ return diff(v1, v2, toStringFunc);
}
inline std::string diffMSS(const std::unordered_map<std::string, std::string>& test, const std::unordered_map<std::string, std::string>& expected) {
std::map<std::string, std::string> v1(test.begin(), test.end());
std::map<std::string, std::string> v2(expected.begin(), expected.end());
- return diff(v1, v2, [](const std::pair<const std::string, std::string>& item) {
- return item.first + '=' + item.second;
- });
+
+ std::string (*toStringFunc)(const std::pair<const std::string, std::string>&) =
+ [](const std::pair<const std::string, std::string>& item) -> std::string { return item.first + '=' + item.second; };
+
+ return diff(v1, v2, toStringFunc);
}
#endif //TGBOT_UTILS_H