aboutsummaryrefslogtreecommitdiffstats
path: root/tests/check_content_parser.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-11-04 01:30:34 -0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-11-04 01:30:34 -0200
commit48d8e5538d3b49f41b35dcfb4f5b8ab3d02a10c2 (patch)
treee924ab90fb3449eb64155edb07877819556e1e67 /tests/check_content_parser.c
parent10e353aa321348e61805be443daca6e1be8bf51f (diff)
downloadblogc-48d8e5538d3b49f41b35dcfb4f5b8ab3d02a10c2.tar.gz
blogc-48d8e5538d3b49f41b35dcfb4f5b8ab3d02a10c2.tar.bz2
blogc-48d8e5538d3b49f41b35dcfb4f5b8ab3d02a10c2.zip
Revert "Revert "content-parser: allow directive params with variable prefix""
This reverts commit 37850db5081e26a26f05d062497811b864953778.
Diffstat (limited to 'tests/check_content_parser.c')
-rw-r--r--tests/check_content_parser.c47
1 files changed, 42 insertions, 5 deletions
diff --git a/tests/check_content_parser.c b/tests/check_content_parser.c
index 8bd16ec..dfb1ffb 100644
--- a/tests/check_content_parser.c
+++ b/tests/check_content_parser.c
@@ -1129,7 +1129,7 @@ test_content_parse_directive(void **state)
will_return(__wrap_blogc_directive_loader, "qwe");
html = blogc_content_parse(
".. bola::\r\n"
- " :asd: qwe\r\n",
+ "\t:asd: qwe\r\n",
NULL);
assert_non_null(html);
assert_string_equal(html,
@@ -1145,8 +1145,8 @@ test_content_parse_directive(void **state)
will_return(__wrap_blogc_directive_loader, "vbn");
html = blogc_content_parse(
".. bola::\n"
- " :asd: qwe\n"
- " :zxc: vbn",
+ "\t\t:asd: qwe\n"
+ "\t\t:zxc: vbn",
NULL);
assert_non_null(html);
assert_string_equal(html,
@@ -1162,8 +1162,8 @@ test_content_parse_directive(void **state)
will_return(__wrap_blogc_directive_loader, "vbn");
html = blogc_content_parse(
".. bola::\n"
- " :asd: qwe\n"
- " :zxc: vbn\n",
+ " :asd: qwe\n"
+ " :zxc: vbn\n",
NULL);
assert_non_null(html);
assert_string_equal(html,
@@ -1412,6 +1412,43 @@ test_content_parse_directive(void **state)
"CHUNDA\n"
"<p>bola</p>\r\n");
free(html);
+
+ will_return(__wrap_blogc_directive_loader, "bola");
+ will_return(__wrap_blogc_directive_loader, "chunda");
+ will_return(__wrap_blogc_directive_loader, 3);
+ will_return(__wrap_blogc_directive_loader, "asd");
+ will_return(__wrap_blogc_directive_loader, "qwe");
+ will_return(__wrap_blogc_directive_loader, "ert");
+ will_return(__wrap_blogc_directive_loader, "zxvc");
+ will_return(__wrap_blogc_directive_loader, "qwe");
+ will_return(__wrap_blogc_directive_loader, "bola");
+ will_return(__wrap_blogc_directive_loader, "bolao");
+ will_return(__wrap_blogc_directive_loader, "chund");
+ will_return(__wrap_blogc_directive_loader, 2);
+ will_return(__wrap_blogc_directive_loader, "asd");
+ will_return(__wrap_blogc_directive_loader, "qwe");
+ will_return(__wrap_blogc_directive_loader, "ert");
+ will_return(__wrap_blogc_directive_loader, "zxvc");
+ html = blogc_content_parse(
+ "# foo\r\n"
+ "\r\n"
+ ".. bola:: chunda\r\n"
+ " :asd: qwe\r\n"
+ " :ert: zxvc\r\n"
+ " :qwe: bola\r\n"
+ "\r\n"
+ ".. bolao:: chund\r\n"
+ " :asd: qwe\r\n"
+ " :ert: zxvc\r\n"
+ "\r\n"
+ "bola", NULL);
+ assert_non_null(html);
+ assert_string_equal(html,
+ "<h1 id=\"foo\">foo</h1>\r\n"
+ "CHUNDA\n"
+ "CHUNDA\n"
+ "<p>bola</p>\r\n");
+ free(html);
}