File tree 2 files changed +12
-1
lines changed 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,8 @@ class Args
62
62
63
63
bool any (const std::vector<std::string>& v) const {
64
64
for (auto && s: v)
65
- return kit::has (m_Args, s);
65
+ if (kit::has (m_Args, s))
66
+ return true ;
66
67
return false ;
67
68
}
68
69
bool has (const std::string& s) const {
Original file line number Diff line number Diff line change @@ -63,6 +63,16 @@ TEST_CASE("Args","[args]") {
63
63
REQUIRE (args.has (' c' , " cchar" ));
64
64
}
65
65
66
+ SECTION (" any" ) {
67
+ Args args;
68
+ args = Args (vector<string>{" foo" , " bar" });
69
+ REQUIRE (not args.any ({" bin" }));
70
+ REQUIRE (not args.any ({" bin" ," baz" }));
71
+ REQUIRE (args.any ({" bar" ," bin" }));
72
+ REQUIRE (args.any ({" bin" ," bar" }));
73
+ REQUIRE (args.any ({" foo" ," bar" }));
74
+ }
75
+
66
76
SECTION (" key-value" ) {
67
77
Args args;
68
78
REQUIRE_NOTHROW (args = Args (vector<string>{" --foo=bar" }));
You can’t perform that action at this time.
0 commit comments