Skip to content

Commit c1d1e74

Browse files
author
Jesse
committed
added no args test
1 parent b2d3681 commit c1d1e74

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

tests.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ struct result {
2323
char* argv[] = {#name, ##__VA_ARGS__}; \
2424
int argc = sizeof(argv) / sizeof(argv[0]); \
2525
ArgumentParser parser(#name); \
26-
code return {true, 0, "", "", ""}; \
26+
code; \
27+
return {true, 0, "", "", ""}; \
2728
}
2829

2930
TEST(no_args, {
@@ -82,9 +83,10 @@ TEST(short_required_flag_does_not_exist, {
8283
#define TT(name) \
8384
{ #name, name }
8485
using test = std::function<result()>;
85-
std::map<std::string, test> tests{
86-
TT(short_optional_flag_exists), TT(short_optional_flag_does_not_exist),
87-
TT(short_required_flag_exists), TT(short_required_flag_does_not_exist)};
86+
std::map<std::string, test> tests{TT(no_args), TT(short_optional_flag_exists),
87+
TT(short_optional_flag_does_not_exist),
88+
TT(short_required_flag_exists),
89+
TT(short_required_flag_does_not_exist)};
8890

8991
int main(int argc, const char* argv[]) {
9092
std::vector<result> results;

0 commit comments

Comments
 (0)