diff options
author | amatanhead <[email protected]> | 2022-02-10 16:50:04 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:50:04 +0300 |
commit | b6f3a80f7c2c8b7dbb0c01b056fdc1fd8cd820e9 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/testing/gtest_extensions/matchers.h | |
parent | 8879605a63ac17539be5b3bd41b529791f4d4b02 (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/testing/gtest_extensions/matchers.h')
-rw-r--r-- | library/cpp/testing/gtest_extensions/matchers.h | 220 |
1 files changed, 110 insertions, 110 deletions
diff --git a/library/cpp/testing/gtest_extensions/matchers.h b/library/cpp/testing/gtest_extensions/matchers.h index 042baa07647..044c1c3ee47 100644 --- a/library/cpp/testing/gtest_extensions/matchers.h +++ b/library/cpp/testing/gtest_extensions/matchers.h @@ -1,132 +1,132 @@ -#pragma once - -#include <util/generic/string.h> - +#pragma once + +#include <util/generic/string.h> + #include <gtest/gtest.h> #include <gmock/gmock.h> - -namespace testing { - /** - * When matching `const TStringBuf&`, implicitly convert other strings and string views to `Eq` matchers. - */ - template <typename T, typename TT> - class Matcher<const TBasicStringBuf<T, TT>&>: public internal::MatcherBase<const TBasicStringBuf<T, TT>&> { - public: - Matcher() { - } - - explicit Matcher(const MatcherInterface<const TBasicStringBuf<T, TT>&>* impl) - : internal::MatcherBase<const TBasicStringBuf<T, TT>&>(impl) { - } - + +namespace testing { + /** + * When matching `const TStringBuf&`, implicitly convert other strings and string views to `Eq` matchers. + */ + template <typename T, typename TT> + class Matcher<const TBasicStringBuf<T, TT>&>: public internal::MatcherBase<const TBasicStringBuf<T, TT>&> { + public: + Matcher() { + } + + explicit Matcher(const MatcherInterface<const TBasicStringBuf<T, TT>&>* impl) + : internal::MatcherBase<const TBasicStringBuf<T, TT>&>(impl) { + } + template <typename M, typename = typename std::remove_reference<M>::type::is_gtest_matcher> Matcher(M&& m) : internal::MatcherBase<const TBasicStringBuf<T, TT>&>(std::forward<M>(m)) { } - Matcher(const TBasicString<T, TT>& s) { - *this = Eq(TBasicStringBuf<T, TT>(s)); - } - - Matcher(const T* s) { - *this = Eq(TBasicStringBuf<T, TT>(s)); - } - - Matcher(TBasicStringBuf<T, TT> s) { - *this = Eq(s); - } - }; - - /** - * When matching `TBasicBuf`, implicitly convert other strings and string views to `Eq` matchers. - */ - template <typename T, typename TT> - class Matcher<TBasicStringBuf<T, TT>>: public internal::MatcherBase<TBasicStringBuf<T, TT>> { - public: - Matcher() { - } - - explicit Matcher(const MatcherInterface <TBasicStringBuf<T, TT>>* impl) - : internal::MatcherBase<TBasicStringBuf<T, TT>>(impl) { - } - - explicit Matcher(const MatcherInterface<const TBasicStringBuf<T, TT>&>* impl) - : internal::MatcherBase<TBasicStringBuf<T, TT>>(impl) { - } - + Matcher(const TBasicString<T, TT>& s) { + *this = Eq(TBasicStringBuf<T, TT>(s)); + } + + Matcher(const T* s) { + *this = Eq(TBasicStringBuf<T, TT>(s)); + } + + Matcher(TBasicStringBuf<T, TT> s) { + *this = Eq(s); + } + }; + + /** + * When matching `TBasicBuf`, implicitly convert other strings and string views to `Eq` matchers. + */ + template <typename T, typename TT> + class Matcher<TBasicStringBuf<T, TT>>: public internal::MatcherBase<TBasicStringBuf<T, TT>> { + public: + Matcher() { + } + + explicit Matcher(const MatcherInterface <TBasicStringBuf<T, TT>>* impl) + : internal::MatcherBase<TBasicStringBuf<T, TT>>(impl) { + } + + explicit Matcher(const MatcherInterface<const TBasicStringBuf<T, TT>&>* impl) + : internal::MatcherBase<TBasicStringBuf<T, TT>>(impl) { + } + template <typename M, typename = typename std::remove_reference<M>::type::is_gtest_matcher> Matcher(M&& m) : internal::MatcherBase<TBasicStringBuf<T, TT>>(std::forward<M>(m)) { } - Matcher(const TBasicString<T, TT>& s) { - *this = Eq(TBasicString<T, TT>(s)); - } - - Matcher(const T* s) { - *this = Eq(TBasicString<T, TT>(s)); - } - - Matcher(TBasicStringBuf<T, TT> s) { - *this = Eq(s); - } - }; - - /** - * When matching `const TString&`, implicitly convert other strings and string views to `Eq` matchers. - */ - template <typename T, typename TT> - class Matcher<const TBasicString<T, TT>&>: public internal::MatcherBase<const TBasicString<T, TT>&> { - public: - Matcher() { - } - - explicit Matcher(const MatcherInterface<const TBasicString<T, TT>&>* impl) - : internal::MatcherBase<const TBasicString<T, TT>&>(impl) { - } - - Matcher(const TBasicString<T, TT>& s) { - *this = Eq(s); - } - + Matcher(const TBasicString<T, TT>& s) { + *this = Eq(TBasicString<T, TT>(s)); + } + + Matcher(const T* s) { + *this = Eq(TBasicString<T, TT>(s)); + } + + Matcher(TBasicStringBuf<T, TT> s) { + *this = Eq(s); + } + }; + + /** + * When matching `const TString&`, implicitly convert other strings and string views to `Eq` matchers. + */ + template <typename T, typename TT> + class Matcher<const TBasicString<T, TT>&>: public internal::MatcherBase<const TBasicString<T, TT>&> { + public: + Matcher() { + } + + explicit Matcher(const MatcherInterface<const TBasicString<T, TT>&>* impl) + : internal::MatcherBase<const TBasicString<T, TT>&>(impl) { + } + + Matcher(const TBasicString<T, TT>& s) { + *this = Eq(s); + } + template <typename M, typename = typename std::remove_reference<M>::type::is_gtest_matcher> Matcher(M&& m) : internal::MatcherBase<const TBasicString<T, TT>&>(std::forward<M>(m)) { } - Matcher(const T* s) { - *this = Eq(TBasicString<T, TT>(s)); - } - }; - - /** - * When matching `TString`, implicitly convert other strings and string views to `Eq` matchers. - */ - template <typename T, typename TT> - class Matcher<TBasicString<T, TT>>: public internal::MatcherBase<TBasicString<T, TT>> { - public: - Matcher() { - } - - explicit Matcher(const MatcherInterface <TBasicString<T, TT>>* impl) - : internal::MatcherBase<TBasicString<T, TT>>(impl) { - } - - explicit Matcher(const MatcherInterface<const TBasicString<T, TT>&>* impl) - : internal::MatcherBase<TBasicString<T, TT>>(impl) { - } - + Matcher(const T* s) { + *this = Eq(TBasicString<T, TT>(s)); + } + }; + + /** + * When matching `TString`, implicitly convert other strings and string views to `Eq` matchers. + */ + template <typename T, typename TT> + class Matcher<TBasicString<T, TT>>: public internal::MatcherBase<TBasicString<T, TT>> { + public: + Matcher() { + } + + explicit Matcher(const MatcherInterface <TBasicString<T, TT>>* impl) + : internal::MatcherBase<TBasicString<T, TT>>(impl) { + } + + explicit Matcher(const MatcherInterface<const TBasicString<T, TT>&>* impl) + : internal::MatcherBase<TBasicString<T, TT>>(impl) { + } + template <typename M, typename = typename std::remove_reference<M>::type::is_gtest_matcher> Matcher(M&& m) : internal::MatcherBase<TBasicString<T, TT>>(std::forward<M>(m)) { } - Matcher(const TBasicString<T, TT>& s) { - *this = Eq(s); - } - - Matcher(const T* s) { - *this = Eq(TBasicString<T, TT>(s)); - } - }; -} + Matcher(const TBasicString<T, TT>& s) { + *this = Eq(s); + } + + Matcher(const T* s) { + *this = Eq(TBasicString<T, TT>(s)); + } + }; +} |