#include #include #include #include namespace ck_tile::test { // Returns a string highlighting differences between actual and expected. // Differences are enclosed in brackets with actual and expected parts separated by '|'. std::string inlineDiff(const std::string& actual, const std::string& expected); // A convenience alias for inlineDiff to improve readability in test assertions. std::string formatInlineDiff(const std::string& actual, const std::string& expected); // Gmock matcher for string equality with inline diff output on failure class StringEqWithDiffMatcher : public ::testing::MatcherInterface { public: explicit StringEqWithDiffMatcher(const std::string& expected); bool MatchAndExplain(std::string actual, ::testing::MatchResultListener* listener) const override; void DescribeTo(std::ostream* os) const override; void DescribeNegationTo(std::ostream* os) const override; private: std::string expected_; }; // Factory function for the StringEqWithDiff matcher ::testing::Matcher StringEqWithDiff(const std::string& expected); } // namespace ck_tile::test