From e41405994636a1bf5be6ea8ea466c2d036de88d5 Mon Sep 17 00:00:00 2001 From: Philip Top Date: Wed, 1 Jan 2025 14:04:39 -0800 Subject: [PATCH] add fuzz fail --- include/CLI/impl/Option_inl.hpp | 3 ++- tests/OptionTypeTest.cpp | 15 +++++++++++++++ tests/fuzzFail/round_trip_custom3 | Bin 0 -> 31 bytes 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/fuzzFail/round_trip_custom3 diff --git a/include/CLI/impl/Option_inl.hpp b/include/CLI/impl/Option_inl.hpp index ae78a2630..b37be4021 100644 --- a/include/CLI/impl/Option_inl.hpp +++ b/include/CLI/impl/Option_inl.hpp @@ -668,7 +668,7 @@ CLI11_INLINE int Option::_add_result(std::string &&result, std::vector cv{ "test" }; + app.add_option("-c", cv); + args = { "-c","test1", "[]"}; + + run(); + CHECK(cv.size()==1); + args = { "-c","test1", "[[]]"}; + + run(); + CHECK(cv.size()==2); + CHECK(cv[1]=="[]"); +} + TEST_CASE_METHOD(TApp, "vectorDoubleArg", "[optiontype]") { std::vector> cv; diff --git a/tests/fuzzFail/round_trip_custom3 b/tests/fuzzFail/round_trip_custom3 new file mode 100644 index 0000000000000000000000000000000000000000..e7991992d99e3a0716c243b14cefad972eb4b805 GIT binary patch literal 31 jcmdPZEpz6ovf*$%#;p(?8w*6-(Lh3>r{{*&e+C8sktYf4 literal 0 HcmV?d00001