MCPcopy Create free account
hub / github.com/bfgroup/Lyra / main

Function main

tests/multiple_flags_run_test.cpp:11–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "mini_test.hpp"
10
11int main()
12{
13 using namespace lyra;
14 bfg::mini_test::scope test;
15
16 {
17 bool a = false, b = false, c = false;
18 auto cli = opt( a )["-a"] | opt( b )["-b"] | opt( c )["-c"];
19 auto result = cli.parse({ "TestApp", "-a", "-b", "-c" });
20 test
21 (REQUIRE(result))
22 (REQUIRE(a))
23 (REQUIRE(b))
24 (REQUIRE(c));
25 }
26 {
27 bool a = false, b = false, c = false;
28 auto cli = opt( a )["-a"] | opt( b )["-b"] | opt( c )["-c"];
29 auto result = cli.parse({ "TestApp", "-abc" });
30 test
31 (REQUIRE(result))
32 (REQUIRE(a))
33 (REQUIRE(b))
34 (REQUIRE(c));
35 }
36
37 return test;
38}

Callers

nothing calls this directly

Calls 2

optClass · 0.50
parseMethod · 0.45

Tested by

no test coverage detected