From 2234450b81e3451a3e14686e80e13e66cf6d2a4a Mon Sep 17 00:00:00 2001 From: Oleg Morozenkov Date: Thu, 26 Jul 2018 00:03:15 +0300 Subject: Test on old ubuntu --- test/utils.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'test/utils.h') 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& test, const std::unordered_map& expected) { std::map v1(test.begin(), test.end()); std::map v2(expected.begin(), expected.end()); - return diff(v1, v2, [](const std::pair& item) { - return item.first + '=' + item.second; - }); + + std::string (*toStringFunc)(const std::pair&) = + [](const std::pair& item) -> std::string { return item.first + '=' + item.second; }; + + return diff(v1, v2, toStringFunc); } #endif //TGBOT_UTILS_H -- cgit v1.2.3