exec: add test for detecting a command not in the list

This commit is contained in:
Peter McGoron 2021-07-30 23:59:40 -04:00
parent 6e5d9d560b
commit 56719d1d35
1 changed files with 12 additions and 0 deletions

View File

@ -61,6 +61,17 @@ TEST execute_multiple(void) {
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();
int main(int argc, char *argv[]) {
@ -68,6 +79,7 @@ int main(int argc, char *argv[]) {
RUN_TEST(execute_one);
RUN_TEST(execute_multiple);
RUN_TEST(not_in);
GREATEST_MAIN_END();
}