diff options
| author | Martin Hořeňovský | 2021-08-26 20:56:18 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-08-26 21:27:43 +0200 |
| commit | ff0a5227caf84d466e3c9c8d6b58469d651e5268 (patch) | |
| tree | fae017eebef8b671741a0c4b7490a70c8aee2d04 /tests/SelfTest/UsageTests/Approx.tests.cpp | |
| parent | 54edab53bf38260a60e42e6faf73ce15b7224fe0 (diff) | |
| download | catch3-ff0a5227caf84d466e3c9c8d6b58469d651e5268.tar.gz | |
Make Approx::operator() const
Closes #2273
Diffstat (limited to 'tests/SelfTest/UsageTests/Approx.tests.cpp')
| -rw-r--r-- | tests/SelfTest/UsageTests/Approx.tests.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/SelfTest/UsageTests/Approx.tests.cpp b/tests/SelfTest/UsageTests/Approx.tests.cpp index 96f9706d..1ae5fe04 100644 --- a/tests/SelfTest/UsageTests/Approx.tests.cpp +++ b/tests/SelfTest/UsageTests/Approx.tests.cpp @@ -209,3 +209,10 @@ TEST_CASE( "Comparison with explicitly convertible types", "[Approx]" ) REQUIRE(Approx(11.0) >= td); } + +TEST_CASE("Approx::operator() is const correct", "[Approx][.approvals]") { + const Approx ap = Approx(0.0).margin(0.01); + + // As long as this compiles, the test should be considered passing + REQUIRE(1.0 == ap(1.0)); +} |