Add more tests for command line parser

This commit is contained in:
Alex Kotov 2020-12-06 02:50:36 +05:00
parent 878ce4b4a9
commit f4007c541f
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 3 additions and 0 deletions

View File

@ -41,10 +41,13 @@ int main()
test(" foo bar ", 0, 0, true, "", 2, argv_foo_bar);
test("foo bar car", 0, 0, true, "", 3, argv_foo_bar_car);
test("foo bar car", 3, 0, true, "", 3, argv_foo_bar_car);
test("foo bar car", 0, 4, true, "", 3, argv_foo_bar_car);
test("foo bar car", 3, 4, true, "", 3, argv_foo_bar_car);
test("foo bar car", 2, 0, false, "too many args", 0, argv0);
test("foo bar car", 0, 3, false, "arg too long", 0, argv0);
test("foo bar car", 2, 3, false, "arg too long", 0, argv0);
return 0;
}