diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/blogc-make/check_exec.c | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/tests/blogc-make/check_exec.c b/tests/blogc-make/check_exec.c index 32c7fae..8193ad7 100644 --- a/tests/blogc-make/check_exec.c +++ b/tests/blogc-make/check_exec.c @@ -88,20 +88,27 @@ test_build_blogc_cmd_with_settings(void **state) settings->tags = NULL; char *rv = bm_exec_build_blogc_cmd("blogc", settings, variables, local, true, - "main.tmpl", "foo.html", false, true); + NULL, "main.tmpl", "foo.html", false, true); assert_string_equal(rv, "LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' -D LOL='HEHE' " "-D ASD='QWE' -l -t 'main.tmpl' -o 'foo.html' -i"); free(rv); + rv = bm_exec_build_blogc_cmd("blogc", settings, variables, local, true, + "foo.txt", "main.tmpl", "foo.html", false, true); + assert_string_equal(rv, + "LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' -D LOL='HEHE' " + "-D ASD='QWE' -l -e 'foo.txt' -t 'main.tmpl' -o 'foo.html' -i"); + free(rv); + rv = bm_exec_build_blogc_cmd("blogc", settings, variables, NULL, false, NULL, - NULL, false, false); + NULL, NULL, false, false); assert_string_equal(rv, "LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' -D LOL='HEHE'"); free(rv); rv = bm_exec_build_blogc_cmd("blogc", settings, NULL, NULL, false, NULL, NULL, - false, false); + NULL, false, false); assert_string_equal(rv, "LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ'"); free(rv); @@ -130,22 +137,30 @@ test_build_blogc_cmd_with_settings_and_dev(void **state) settings->tags = NULL; char *rv = bm_exec_build_blogc_cmd("blogc", settings, variables, local, true, - "main.tmpl", "foo.html", true, true); + NULL, "main.tmpl", "foo.html", true, true); assert_string_equal(rv, "LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' -D LOL='HEHE' " "-D ASD='QWE' -D MAKE_ENV_DEV=1 -D MAKE_ENV='dev' -l -t 'main.tmpl' " "-o 'foo.html' -i"); free(rv); + rv = bm_exec_build_blogc_cmd("blogc", settings, variables, local, true, + "foo.txt", "main.tmpl", "foo.html", true, true); + assert_string_equal(rv, + "LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' -D LOL='HEHE' " + "-D ASD='QWE' -D MAKE_ENV_DEV=1 -D MAKE_ENV='dev' -l -e 'foo.txt' " + "-t 'main.tmpl' -o 'foo.html' -i"); + free(rv); + rv = bm_exec_build_blogc_cmd("blogc", settings, variables, NULL, false, NULL, - NULL, true, false); + NULL, NULL, true, false); assert_string_equal(rv, "LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' -D LOL='HEHE' " "-D MAKE_ENV_DEV=1 -D MAKE_ENV='dev'"); free(rv); rv = bm_exec_build_blogc_cmd("blogc", settings, NULL, NULL, false, NULL, NULL, - true, false); + NULL, true, false); assert_string_equal(rv, "LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' " "-D MAKE_ENV_DEV=1 -D MAKE_ENV='dev'"); @@ -175,22 +190,30 @@ test_build_blogc_cmd_with_settings_and_tags(void **state) settings->tags = bc_str_split("asd foo bar", ' ', 0); char *rv = bm_exec_build_blogc_cmd("blogc", settings, variables, local, true, - "main.tmpl", "foo.html", true, true); + NULL, "main.tmpl", "foo.html", true, true); assert_string_equal(rv, "LC_ALL='en_US.utf8' blogc -D MAKE_TAGS='asd foo bar' -D FOO='BAR' " "-D BAR='BAZ' -D LOL='HEHE' -D ASD='QWE' -D MAKE_ENV_DEV=1 " "-D MAKE_ENV='dev' -l -t 'main.tmpl' -o 'foo.html' -i"); free(rv); + rv = bm_exec_build_blogc_cmd("blogc", settings, variables, local, true, + "foo.txt", "main.tmpl", "foo.html", true, true); + assert_string_equal(rv, + "LC_ALL='en_US.utf8' blogc -D MAKE_TAGS='asd foo bar' -D FOO='BAR' " + "-D BAR='BAZ' -D LOL='HEHE' -D ASD='QWE' -D MAKE_ENV_DEV=1 " + "-D MAKE_ENV='dev' -l -e 'foo.txt' -t 'main.tmpl' -o 'foo.html' -i"); + free(rv); + rv = bm_exec_build_blogc_cmd("blogc", settings, variables, NULL, false, NULL, - NULL, true, false); + NULL, NULL, true, false); assert_string_equal(rv, "LC_ALL='en_US.utf8' blogc -D MAKE_TAGS='asd foo bar' -D FOO='BAR' " "-D BAR='BAZ' -D LOL='HEHE' -D MAKE_ENV_DEV=1 -D MAKE_ENV='dev'"); free(rv); rv = bm_exec_build_blogc_cmd("blogc", settings, NULL, NULL, false, NULL, NULL, - true, false); + NULL, true, false); assert_string_equal(rv, "LC_ALL='en_US.utf8' blogc -D MAKE_TAGS='asd foo bar' -D FOO='BAR' " "-D BAR='BAZ' -D MAKE_ENV_DEV=1 -D MAKE_ENV='dev'"); @@ -214,19 +237,26 @@ test_build_blogc_cmd_without_settings(void **state) bc_trie_insert(local, "ASD", bc_strdup("QWE")); char *rv = bm_exec_build_blogc_cmd("blogc", NULL, variables, local, true, - "main.tmpl", "foo.html", false, true); + NULL, "main.tmpl", "foo.html", false, true); assert_string_equal(rv, "blogc -D LOL='HEHE' -D ASD='QWE' -l -t 'main.tmpl' -o 'foo.html' -i"); free(rv); + rv = bm_exec_build_blogc_cmd("blogc", NULL, variables, local, true, + "foo.txt", "main.tmpl", "foo.html", false, true); + assert_string_equal(rv, + "blogc -D LOL='HEHE' -D ASD='QWE' -l -e 'foo.txt' -t 'main.tmpl' " + "-o 'foo.html' -i"); + free(rv); + rv = bm_exec_build_blogc_cmd("blogc", NULL, variables, NULL, false, NULL, - NULL, false, false); + NULL, NULL, false, false); assert_string_equal(rv, "blogc -D LOL='HEHE'"); free(rv); rv = bm_exec_build_blogc_cmd("blogc", NULL, NULL, NULL, false, NULL, NULL, - false, false); + NULL, false, false); assert_string_equal(rv, "blogc"); free(rv); |