diff options
| author | Leitwolf | 2026-11-16 14:48:58 +0300 |
|---|---|---|
| committer | GitHub | 2026-11-16 14:48:58 +0300 |
| commit | 064a9ebb87c5afd55b0cd00b37ebaf849a9306b4 (patch) | |
| tree | 6610ab918c8b33b46bfb97e4efb718e5fef42b87 /tests/Progmasoft/BazelModule/OwnMain.tests.cpp | |
| parent | 0cc73f2c53f40a172dd5bbfee0c96d25599d9dba (diff) | |
| parent | 57dc4f2fee6881884b10085e85927a0c1710ea61 (diff) | |
| download | catch3-064a9ebb87c5afd55b0cd00b37ebaf849a9306b4.tar.gz | |
Merge branch 'devel' into security/bounded-strings
Diffstat (limited to 'tests/Progmasoft/BazelModule/OwnMain.tests.cpp')
| -rw-r--r-- | tests/Progmasoft/BazelModule/OwnMain.tests.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/Progmasoft/BazelModule/OwnMain.tests.cpp b/tests/Progmasoft/BazelModule/OwnMain.tests.cpp new file mode 100644 index 00000000..92c4d711 --- /dev/null +++ b/tests/Progmasoft/BazelModule/OwnMain.tests.cpp @@ -0,0 +1,31 @@ +// Copyright (c) 2026 Progmasoft. +// SPDX-License-Identifier: LGPL-3.0-or-later + +// 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("Sections run against a fresh fixture", "[module]") +{ + 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 +main(int argc, char **argv) +{ + Catch::Session session; + return session.run(argc, argv); +} |