MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / TEST

Function TEST

test/po/subcommand.cpp:14–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12using namespace std::literals;
13
14TEST(SubCommands, Simple1) {
15 SubCommand S1(Description("s1"sv));
16 SubCommand S2(Description("s2"sv));
17 ArgumentParser Parser;
18 Parser.begin_subcommand(S1, "s1"sv)
19 .end_subcommand()
20 .begin_subcommand(S2, "s2"sv)
21 .end_subcommand();
22 std::array Args = {"test"};
23 EXPECT_TRUE(Parser.parse(stdout, static_cast<int>(Args.size()), Args.data()));
24 EXPECT_FALSE(S1.is_selected());
25 EXPECT_FALSE(S2.is_selected());
26}
27
28TEST(SubCommands, Simple2) {
29 SubCommand S1(Description("s1"sv));

Callers

nothing calls this directly

Calls 7

DescriptionClass · 0.85
is_selectedMethod · 0.80
parseMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
add_optionMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected