Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-08-26 20:56:18 +0200
committerMartin Hořeňovský2021-08-26 21:27:43 +0200
commitff0a5227caf84d466e3c9c8d6b58469d651e5268 (patch)
treefae017eebef8b671741a0c4b7490a70c8aee2d04 /tests/SelfTest
parent54edab53bf38260a60e42e6faf73ce15b7224fe0 (diff)
downloadcatch3-ff0a5227caf84d466e3c9c8d6b58469d651e5268.tar.gz
Make Approx::operator() const
Closes #2273
Diffstat (limited to 'tests/SelfTest')
-rw-r--r--tests/SelfTest/UsageTests/Approx.tests.cpp7
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));
+}