summaryrefslogtreecommitdiff
path: root/test/test_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_cli.c')
-rw-r--r--test/test_cli.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/test_cli.c b/test/test_cli.c
index 5a5f0db..00cc84e 100644
--- a/test/test_cli.c
+++ b/test/test_cli.c
@@ -22,11 +22,33 @@
#include "minunit.h"
#include "cli.h"
+#include "crypto.h"
+
+extern int tests_run;
char *test_out_path(void) {
- char *argv[4] = {"nekopack", "-o", "/tmp", "a.xp3"};
+ char *argv[] = {"nekopack", "-o", "/tmp", "a.xp3"};
struct params p = parse_args(4, argv);
mu_assert("Trailing slash not appended to path", !strcmp(p.out, "/tmp/"));
+ params_free(p);
+ return NULL;
+}
+
+
+char *test_vararg_index(void) {
+ char *argv[] = {"nekopack", "-l", "a.xp3"};
+ struct params p = parse_args(3, argv);
+ mu_assert("Invalid vararg index", !strcmp("a.xp3", argv[p.vararg_index]));
+ params_free(p);
+ return NULL;
+}
+
+
+char *test_game_id(void) {
+ char *argv[] = {"nekopack", "-g", "nekopara_volume_1", "a.xp3"};
+ struct params p = parse_args(4, argv);
+ mu_assert("Incorrect game ID", p.game == NEKOPARA_VOLUME_1);
+ params_free(p);
return NULL;
}