diff options
author | tkhanipov <[email protected]> | 2022-02-10 16:49:46 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:46 +0300 |
commit | 60c0dade397b9b2f9a22f5daa5b2ea5e433e6e40 (patch) | |
tree | 4acdda76eaabc40a9ee1a272dc41f7a3862409ec /library/cpp/testing/unittest/registar_ut.cpp | |
parent | a27ec9dbf04ab9972fd470b53b8bdd41153226e5 (diff) |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/testing/unittest/registar_ut.cpp')
-rw-r--r-- | library/cpp/testing/unittest/registar_ut.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/testing/unittest/registar_ut.cpp b/library/cpp/testing/unittest/registar_ut.cpp index 1f36d53abbe..81827e75713 100644 --- a/library/cpp/testing/unittest/registar_ut.cpp +++ b/library/cpp/testing/unittest/registar_ut.cpp @@ -301,15 +301,15 @@ Y_UNIT_TEST_SUITE(TUnitTestMacroTest) { UNIT_ASSERT_EXCEPTION_CONTAINS(Throw(), TExpectedException, substr); } - template <class TExpectedException, class P> - void AssertExceptionSatisfies(const P& predicate) { - UNIT_ASSERT_EXCEPTION_SATISFIES(Throw(), TExpectedException, predicate); - } - - int GetValue() const { - return 5; // just some value for predicate testing - } - + template <class TExpectedException, class P> + void AssertExceptionSatisfies(const P& predicate) { + UNIT_ASSERT_EXCEPTION_SATISFIES(Throw(), TExpectedException, predicate); + } + + int GetValue() const { + return 5; // just some value for predicate testing + } + bool ThrowMe; }; @@ -362,12 +362,12 @@ Y_UNIT_TEST_SUITE(TUnitTestMacroTest) { UNIT_ASSERT_EXCEPTION_CONTAINS(TTestException("abc").Throw(), TTestException, "a"); } - - Y_UNIT_TEST(ExceptionSatisfies) { - const auto goodPredicate = [](const TTestException& e) { return e.GetValue() == 5; }; - const auto badPredicate = [](const TTestException& e) { return e.GetValue() != 5; }; - UNIT_ASSERT_NO_EXCEPTION(TTestException().AssertExceptionSatisfies<TTestException>(goodPredicate)); - UNIT_ASSERT_TEST_FAILS(TTestException().AssertExceptionSatisfies<TTestException>(badPredicate)); - UNIT_ASSERT_TEST_FAILS(TTestException().AssertExceptionSatisfies<TOtherTestException>(goodPredicate)); - } + + Y_UNIT_TEST(ExceptionSatisfies) { + const auto goodPredicate = [](const TTestException& e) { return e.GetValue() == 5; }; + const auto badPredicate = [](const TTestException& e) { return e.GetValue() != 5; }; + UNIT_ASSERT_NO_EXCEPTION(TTestException().AssertExceptionSatisfies<TTestException>(goodPredicate)); + UNIT_ASSERT_TEST_FAILS(TTestException().AssertExceptionSatisfies<TTestException>(badPredicate)); + UNIT_ASSERT_TEST_FAILS(TTestException().AssertExceptionSatisfies<TOtherTestException>(goodPredicate)); + } } |