diff options
| author | jakob <jakob@memeware.net> | 2017-04-12 16:54:36 -0400 |
|---|---|---|
| committer | jakob <jakob@memeware.net> | 2017-04-12 16:54:36 -0400 |
| commit | 07347dcaa361607a924178eff787177e8cca6d68 (patch) | |
| tree | 5109650cbaf0a8ff5a9dadad5ab912f1cf59911d /test/test_cli.c | |
| parent | 411a40b5c077ca69e34c7016428eb9d856f8fe73 (diff) | |
Expanded tests for the command-line interface.
Diffstat (limited to 'test/test_cli.c')
| -rw-r--r-- | test/test_cli.c | 24 |
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; } |