exec: add test for detecting a command not in the list
This commit is contained in:
parent
6e5d9d560b
commit
56719d1d35
12
test/exec.c
12
test/exec.c
|
@ -61,6 +61,17 @@ TEST execute_multiple(void) {
|
||||||
PASS();
|
PASS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST not_in(void) {
|
||||||
|
struct libscomm_line x = {0};
|
||||||
|
x.len = 1;
|
||||||
|
|
||||||
|
doexec("test2", LIBSCOMM_NOT_FOUND);
|
||||||
|
doexec("flub", LIBSCOMM_NOT_FOUND);
|
||||||
|
doexec("doexec", LIBSCOMM_NOT_FOUND);
|
||||||
|
|
||||||
|
PASS();
|
||||||
|
}
|
||||||
|
|
||||||
GREATEST_MAIN_DEFS();
|
GREATEST_MAIN_DEFS();
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
@ -68,6 +79,7 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
RUN_TEST(execute_one);
|
RUN_TEST(execute_one);
|
||||||
RUN_TEST(execute_multiple);
|
RUN_TEST(execute_multiple);
|
||||||
|
RUN_TEST(not_in);
|
||||||
|
|
||||||
GREATEST_MAIN_END();
|
GREATEST_MAIN_END();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue