added a unit test for a function in "argv-utils.c" (#26760)
* added a unit test for argv-utils.c
This commit is contained in:
@@ -115,6 +115,15 @@ TEST(rename_process) {
|
||||
test_rename_process_one("1234567", 1); /* should always fit */
|
||||
}
|
||||
|
||||
TEST(argv_help) {
|
||||
assert_se(argv_looks_like_help(1, STRV_MAKE("program")));
|
||||
assert_se(argv_looks_like_help(2, STRV_MAKE("program", "help")));
|
||||
assert_se(argv_looks_like_help(3, STRV_MAKE("program", "arg1", "--help")));
|
||||
assert_se(argv_looks_like_help(4, STRV_MAKE("program", "arg1", "arg2", "-h")));
|
||||
assert_se(!argv_looks_like_help(2, STRV_MAKE("program", "arg1")));
|
||||
assert_se(!argv_looks_like_help(4, STRV_MAKE("program", "arg1", "arg2", "--h")));
|
||||
}
|
||||
|
||||
static int intro(void) {
|
||||
log_show_color(true);
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user