1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2025-03-31 17:25:22 -04:00

Improve tests for command line parser

This commit is contained in:
Alex Kotov 2020-12-02 02:38:14 +05:00
parent 908110cc25
commit 7c6364af54
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -27,137 +27,29 @@ static const char *const argv_foo_bar_car[] = {"foo", "bar", "car"};
int main() int main()
{ {
test( test("", 0, 0, KERNAUX_TRUE, "", 0, argv0);
"",
0,
0,
KERNAUX_TRUE, test(" ", 0, 0, KERNAUX_TRUE, "", 0, argv0);
"",
0,
argv0
);
test( test("foo", 0, 0, KERNAUX_TRUE, "", 1, argv_foo);
" ",
0,
0,
KERNAUX_TRUE, test("foo bar", 0, 0, KERNAUX_TRUE, "", 2, argv_foo_bar);
"",
0,
argv0
);
test( test(" foo bar", 0, 0, KERNAUX_TRUE, "", 2, argv_foo_bar);
"foo",
0,
0,
KERNAUX_TRUE, test("foo bar ", 0, 0, KERNAUX_TRUE, "", 2, argv_foo_bar);
"",
1,
argv_foo
);
test( test(" foo bar ", 0, 0, KERNAUX_TRUE, "", 2, argv_foo_bar);
"foo bar",
0,
0,
KERNAUX_TRUE, test("foo bar", 0, 0, KERNAUX_TRUE, "", 2, argv_foo_bar);
"",
2,
argv_foo_bar
);
test( test(" foo bar", 0, 0, KERNAUX_TRUE, "", 2, argv_foo_bar);
" foo bar",
0,
0,
KERNAUX_TRUE, test("foo bar ", 0, 0, KERNAUX_TRUE, "", 2, argv_foo_bar);
"",
2,
argv_foo_bar
);
test( test(" foo bar ", 0, 0, KERNAUX_TRUE, "", 2, argv_foo_bar);
"foo bar ",
0,
0,
KERNAUX_TRUE, test("foo bar car", 0, 0, KERNAUX_TRUE, "", 3, argv_foo_bar_car);
"",
2,
argv_foo_bar
);
test(
" foo bar ",
0,
0,
KERNAUX_TRUE,
"",
2,
argv_foo_bar
);
test(
"foo bar",
0,
0,
KERNAUX_TRUE,
"",
2,
argv_foo_bar
);
test(
" foo bar",
0,
0,
KERNAUX_TRUE,
"",
2,
argv_foo_bar
);
test(
"foo bar ",
0,
0,
KERNAUX_TRUE,
"",
2,
argv_foo_bar
);
test(
" foo bar ",
0,
0,
KERNAUX_TRUE,
"",
2,
argv_foo_bar
);
test(
"foo bar car",
0,
0,
KERNAUX_TRUE,
"",
3,
argv_foo_bar_car
);
return 0; return 0;
} }