From 530a3ef5ed894ab3e1d20e910e599d41058b9590 Mon Sep 17 00:00:00 2001 From: Laurent MAZET Date: Thu, 2 May 2024 17:30:17 +0200 Subject: [PATCH] add tests --- cmd.c | 2 ++ cmore.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cmd.c b/cmd.c index 06a3b2a..11238c3 100644 --- a/cmd.c +++ b/cmd.c @@ -35,6 +35,7 @@ char *exec_cmd (char *cmd) } if (status == -1) { + VERBOSE (ERROR, fprintf (stderr, "can't exec command: %s\n", cmd)); free (buffer); buffer = NULL; } @@ -55,6 +56,7 @@ char *load_file (char *name) } if (status == -1) { + VERBOSE (ERROR, fprintf (stderr, "can't load file: %s\n", name)); free (buffer); buffer = NULL; } diff --git a/cmore.c b/cmore.c index 89054e1..983e636 100644 --- a/cmore.c +++ b/cmore.c @@ -225,7 +225,9 @@ int main (int argc, char *argv[]) /* test: cmore.exe -h | grep usage */ /* test: cmore.exe -c 2>&1 | grep error */ +/* test: cmore.exe -c notAnExistingCommand 2>&1 | grep can\'t */ /* test: cmore.exe -f 2>&1 | grep error */ +/* test: cmore.exe -f notAnExistingFile 2>&1 | grep can\'t */ /* test: (sleep 1; echo -n q) | cmore.exe -c 'ip addr' */ /* test: (sleep 1; echo -ne '\e\e') | cmore.exe -f tui.c */ /* test: (sleep 1; echo -n kkkkk; sleep 1; echo -n i; sleep 1; echo -n q) | cmore.exe -c 'ip addr' */ -- 2.30.2