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/WithMain.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/WithMain.tests.cpp')
| -rw-r--r-- | tests/Progmasoft/BazelModule/WithMain.tests.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/Progmasoft/BazelModule/WithMain.tests.cpp b/tests/Progmasoft/BazelModule/WithMain.tests.cpp new file mode 100644 index 00000000..60f67ed1 --- /dev/null +++ b/tests/Progmasoft/BazelModule/WithMain.tests.cpp @@ -0,0 +1,29 @@ +// Copyright (c) 2026 Progmasoft. +// SPDX-License-Identifier: LGPL-3.0-or-later + +// Tests linked with @progmasoft_catch3//:catch3_main, which brings main. +#include <Progmasoft/Catch3/Generators/Generators.hpp> +#include <Progmasoft/Catch3/TestMacros.hpp> +#include <string> + +namespace +{ + std::string + Repeat(const std::string &text, int count) + { + std::string result; + for (int i = 0; i < count; ++i) + { + result += text; + } + return result; + } +} // namespace + +TEST_CASE("Generated values reach the test", "[module]") +{ + const int count = GENERATE(0, 1, 3); + const std::string repeated = Repeat("ab", count); + REQUIRE(repeated.size() == static_cast<std::size_t>(2 * count)); + CHECK(repeated.find("ba") == (count > 1 ? 1U : std::string::npos)); +} |