diff options
| author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-11-04 03:30:58 -0200 | 
|---|---|---|
| committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-11-04 03:30:58 -0200 | 
| commit | 579c1d8c1f9a6b5bfc16d9f0b02dbab2e0acb0ed (patch) | |
| tree | a955bdbeee948527c168355125a6471ed80e93ca /tests | |
| parent | 43bb8973e683743e780895f99f46364c7d85457f (diff) | |
| download | blogc-579c1d8c1f9a6b5bfc16d9f0b02dbab2e0acb0ed.tar.gz blogc-579c1d8c1f9a6b5bfc16d9f0b02dbab2e0acb0ed.tar.bz2 blogc-579c1d8c1f9a6b5bfc16d9f0b02dbab2e0acb0ed.zip | |
content-parser: random parser fixes
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/check_content_parser.c | 34 | 
1 files changed, 30 insertions, 4 deletions
| diff --git a/tests/check_content_parser.c b/tests/check_content_parser.c index 994e900..dc3485e 100644 --- a/tests/check_content_parser.c +++ b/tests/check_content_parser.c @@ -1135,6 +1135,14 @@ test_content_parse_invalid_blockquote(void **state)          "> bola\n"          ">   foo</p>\n");      free(html); +    html = blogc_content_parse( +        ">   asd\n" +        "> bola", NULL); +    assert_non_null(html); +    assert_string_equal(html, +        "<p>>   asd\n" +        "> bola</p>\n"); +    free(html);  } @@ -1151,6 +1159,16 @@ test_content_parse_invalid_code(void **state)          "  bola\n"          "    foo</p>\n");      free(html); +    html = blogc_content_parse( +        "    asd\n" +        "  bola\n" +        "    foo", NULL); +    assert_non_null(html); +    assert_string_equal(html, +        "<p>    asd\n" +        "  bola\n" +        "    foo</p>\n"); +    free(html);  } @@ -1196,7 +1214,8 @@ test_content_parse_invalid_unordered_list(void **state)      assert_non_null(html);      assert_string_equal(html,          "<p><em>  asd\n" -        "1. qwe</p>\n"); +        "1. qwe" +        "</p>\n");      free(html);      html = blogc_content_parse(          "* asd\n" @@ -1204,7 +1223,8 @@ test_content_parse_invalid_unordered_list(void **state)      assert_non_null(html);      assert_string_equal(html,          "<p><em> asd\n" -        "1. qwe</p>\n"); +        "1. qwe" +        "</p>\n");      free(html);      html = blogc_content_parse(          "chunda\n" @@ -1250,7 +1270,8 @@ test_content_parse_invalid_ordered_list(void **state)      assert_non_null(html);      assert_string_equal(html,          "<p>1. asd\n" -        "<em>  qwe</p>\n"); +        "<em>  qwe" +        "</p>\n");      free(html);      html = blogc_content_parse(          "1. asd\n" @@ -1258,7 +1279,8 @@ test_content_parse_invalid_ordered_list(void **state)      assert_non_null(html);      assert_string_equal(html,          "<p>1. asd\n" -        "<em>  qwe</p>\n"); +        "<em>  qwe" +        "</p>\n");      free(html);      html = blogc_content_parse(          "chunda\n" @@ -1303,6 +1325,10 @@ test_content_parse_invalid_ordered_list(void **state)      assert_non_null(html);      assert_string_equal(html, "<p>1.</p>\n");      free(html); +    html = blogc_content_parse("1 ", NULL); +    assert_non_null(html); +    assert_string_equal(html, "<p>1 </p>\n"); +    free(html);  } | 
