MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / SameString

Class SameString

Tests/config/rapidjsonhelper.cpp:62–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60 }
61
62 class SameString {
63 std::wstring_view m_MatchStr;
64
65 void DescribeHelper(bool matches, std::ostream *os) const
66 {
67 *os << "is";
68 if (!matches)
69 {
70 *os << "n't";
71 }
72
73 *os << " equal to " << testing::PrintToString(std::wstring(m_MatchStr));
74 }
75
76 public:
77 using is_gtest_matcher = void;
78
79 constexpr SameString(std::wstring_view str) noexcept : m_MatchStr(str) { }
80
81 constexpr bool MatchAndExplain(const std::tuple<const wchar_t *, rj::SizeType> &args, std::ostream *) const noexcept
82 {
83 return m_MatchStr == std::wstring_view { std::get<0>(args), std::get<1>(args) };
84 }
85
86 void DescribeTo(std::ostream *os) const { DescribeHelper(true, os); }
87 void DescribeNegationTo(std::ostream *os) const { DescribeHelper(false, os); }
88 };
89}
90
91TEST(RapidJSONHelper_TypeChecks, ReturnsTrueOnSameType)

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected