diff options
| author | Leitwolf11 | 2026-11-16 12:42:14 +0300 |
|---|---|---|
| committer | Leitwolf11 | 2026-11-16 12:42:14 +0300 |
| commit | 5a63d9c746daa1748db7622a5e3effb9ca5c4b40 (patch) | |
| tree | f04d44d03b84c93b0383dfbce492b32b1c23dc76 /tests/Progmasoft/BazelModule/OwnMain.tests.cpp | |
| parent | c7c952b01ef0895f82d381e7ad23172a0edaaab1 (diff) | |
| download | catch3-build/bcr.tar.gz | |
Test behavior in the test module, not constantsbuild/bcr
Codacy (cppcheck) found both conditions always true. The module now
checks a generated repetition count with catch3_main, and sections that
each start from the same fixture with its own main.
Claude-Session: https://claude.ai/code/session_01Ji7xZMYjc4zankoc7hGBE1
Diffstat (limited to 'tests/Progmasoft/BazelModule/OwnMain.tests.cpp')
| -rw-r--r-- | tests/Progmasoft/BazelModule/OwnMain.tests.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/Progmasoft/BazelModule/OwnMain.tests.cpp b/tests/Progmasoft/BazelModule/OwnMain.tests.cpp index e544bf4d..92c4d711 100644 --- a/tests/Progmasoft/BazelModule/OwnMain.tests.cpp +++ b/tests/Progmasoft/BazelModule/OwnMain.tests.cpp @@ -4,10 +4,23 @@ // Tests linked with @progmasoft_catch3//:catch3, with a main of their own. #include <Progmasoft/Catch3/Session.hpp> #include <Progmasoft/Catch3/TestMacros.hpp> +#include <algorithm> +#include <vector> -TEST_CASE("A test runs under its own main", "[module]") +TEST_CASE("Sections run against a fresh fixture", "[module]") { - REQUIRE(1 + 1 == 2); + std::vector<int> values{ 3, 1, 2 }; + + SECTION("sorting orders the values") + { + std::sort(values.begin(), values.end()); + REQUIRE(std::is_sorted(values.begin(), values.end())); + CHECK(values.front() < values.back()); + } + SECTION("each section starts from the same values") + { + CHECK_FALSE(std::is_sorted(values.begin(), values.end())); + } } int |