aboutsummaryrefslogtreecommitdiffstats
path: root/tests/check_content_parser.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-05-06 02:21:07 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-05-06 02:21:07 -0300
commit903c8313bc1f8a1ce3d97fc944293d79ccdac76c (patch)
treee8378bc6c2c90bb720b9db4b98e31d0217be1702 /tests/check_content_parser.c
parentaf37850094238ae94ee4a48588a8490a210f9ad6 (diff)
downloadblogc-903c8313bc1f8a1ce3d97fc944293d79ccdac76c.tar.gz
blogc-903c8313bc1f8a1ce3d97fc944293d79ccdac76c.tar.bz2
blogc-903c8313bc1f8a1ce3d97fc944293d79ccdac76c.zip
content-parsed: started inline parser
Diffstat (limited to 'tests/check_content_parser.c')
-rw-r--r--tests/check_content_parser.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/check_content_parser.c b/tests/check_content_parser.c
index b3e7092..a613052 100644
--- a/tests/check_content_parser.c
+++ b/tests/check_content_parser.c
@@ -56,7 +56,9 @@ test_content_parse(void **state)
"</style>\n"
"\n"
"guda\n"
- "yay";
+ "yay\n"
+ "\n"
+ "**bola**\n";
blogc_error_t *err = NULL;
char *html = blogc_content_parse(a, strlen(a), &err);
assert_null(err);
@@ -91,7 +93,8 @@ test_content_parse(void **state)
" chunda\n"
"</style>\n"
"<p>guda\n"
- "yay</p>\n");
+ "yay</p>\n"
+ "<p>**bola**</p>\n");
free(html);
}
@@ -319,6 +322,18 @@ test_content_parse_invalid_code(void **state)
}
+void
+test_content_parse_inline(void **state)
+{
+ char *html = blogc_content_parse_inline("**bola***asd* ``chunda``");
+ assert_string_equal(html, "<strong>bola</strong><em>asd</em> <code>chunda</code>");
+ free(html);
+ html = blogc_content_parse_inline("*bola*");
+ assert_string_equal(html, "<em>bola</em>");
+ free(html);
+}
+
+
int
main(void)
{
@@ -332,6 +347,7 @@ main(void)
unit_test(test_content_parse_invalid_header_empty),
unit_test(test_content_parse_invalid_blockquote),
unit_test(test_content_parse_invalid_code),
+ unit_test(test_content_parse_inline),
};
return run_tests(tests);
}