mirror of
https://github.com/CLIUtils/CLI11.git
synced 2026-01-19 04:52:08 +00:00
Ci build update (#1151)
update ci build images, remove ubuntu 20.04 and update a few others, fix some newer clang-tidy warnings --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -2615,7 +2615,6 @@ TEST_CASE_METHOD(TApp, "EmptyOptionEach", "[app]") {
|
||||
|
||||
// #122
|
||||
TEST_CASE_METHOD(TApp, "EmptyOptionFail", "[app]") {
|
||||
std::string q;
|
||||
app.add_option("--each");
|
||||
|
||||
args = {"--each", "that"};
|
||||
|
||||
@@ -1590,7 +1590,6 @@ TEST_CASE_METHOD(TApp, "TOMLVectorVector", "[config]") {
|
||||
|
||||
run();
|
||||
|
||||
auto str = app.config_to_str();
|
||||
CHECK(two == std::vector<std::vector<int>>({{1, 2, 3}, {4, 5, 6}}));
|
||||
CHECK(three == std::vector<int>({1, 2, 3, 4, 5, 6}));
|
||||
CHECK(four == std::vector<int>({1, 2, 3, 4, 5, 6, 7, 8}));
|
||||
@@ -1621,7 +1620,6 @@ TEST_CASE_METHOD(TApp, "TOMLVectorVectorSeparated", "[config]") {
|
||||
|
||||
run();
|
||||
|
||||
auto str = app.config_to_str();
|
||||
CHECK(two == std::vector<std::vector<int>>({{1, 2, 3}, {4, 5, 6}}));
|
||||
CHECK(three == std::vector<int>({1, 2, 3, 4, 5, 6}));
|
||||
}
|
||||
@@ -1653,7 +1651,6 @@ TEST_CASE_METHOD(TApp, "TOMLVectorVectorSeparatedSingleElement", "[config]") {
|
||||
|
||||
run();
|
||||
|
||||
auto str = app.config_to_str();
|
||||
CHECK(two == std::vector<std::vector<int>>({{1}, {2}, {3}}));
|
||||
CHECK(three == std::vector<int>({1, 4, 5}));
|
||||
}
|
||||
|
||||
@@ -342,7 +342,6 @@ TEST_CASE("app_roundtrip_parse_normal_fail") {
|
||||
CLI::FuzzApp fuzzdata;
|
||||
auto app = fuzzdata.generateApp();
|
||||
int index = GENERATE(range(1, 4));
|
||||
std::string optionString, flagString;
|
||||
auto parseData = loadFailureFile("parse_fail_check", index);
|
||||
std::size_t pstring_start{0};
|
||||
pstring_start = fuzzdata.add_custom_options(app.get(), parseData);
|
||||
|
||||
@@ -1320,7 +1320,7 @@ TEST_CASE("Types: TypeName", "[helpers]") {
|
||||
std::string text2_name = CLI::detail::type_name<char *>();
|
||||
CHECK(text2_name == "TEXT");
|
||||
|
||||
enum class test { test1, test2, test3 };
|
||||
enum class test : std::uint8_t { test1, test2, test3 };
|
||||
std::string enum_name = CLI::detail::type_name<test>();
|
||||
CHECK(enum_name == "ENUM");
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
using Catch::literals::operator"" _a;
|
||||
using Catch::Matchers::WithinRel;
|
||||
|
||||
TEST_CASE_METHOD(TApp, "OneStringAgain", "[optiontype]") {
|
||||
std::string str;
|
||||
@@ -56,9 +56,9 @@ TEST_CASE_METHOD(TApp, "doubleFunction", "[optiontype]") {
|
||||
app.add_option_function<double>("--val", [&res](double val) { res = std::abs(val + 54); });
|
||||
args = {"--val", "-354.356"};
|
||||
run();
|
||||
CHECK(300.356_a == res);
|
||||
CHECK_THAT(res, WithinRel(300.356));
|
||||
// get the original value as entered as an integer
|
||||
CHECK(-354.356_a == app["--val"]->as<float>());
|
||||
CHECK_THAT(app["--val"]->as<float>(), WithinRel(-354.356f));
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(TApp, "doubleFunctionFail", "[optiontype]") {
|
||||
@@ -77,8 +77,8 @@ TEST_CASE_METHOD(TApp, "doubleVectorFunction", "[optiontype]") {
|
||||
args = {"--val", "5", "--val", "6", "--val", "7"};
|
||||
run();
|
||||
CHECK(3u == res.size());
|
||||
CHECK(10.0_a == res[0]);
|
||||
CHECK(12.0_a == res[2]);
|
||||
CHECK_THAT(res[0], WithinRel(10.0));
|
||||
CHECK_THAT(res[2], WithinRel(12.0));
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(TApp, "doubleVectorFunctionFail", "[optiontype]") {
|
||||
|
||||
Reference in New Issue
Block a user