diff options
| author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-02-21 15:13:34 +0100 | 
|---|---|---|
| committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-02-21 15:13:34 +0100 | 
| commit | b73afb052337d3c11d90efb5e90c2818063dda4d (patch) | |
| tree | 3f74bd4e205e9d25267d8d40e2700e87ac295727 | |
| parent | de334a9e32d0d1d19c4aa98415cfe35866686157 (diff) | |
| download | blogc-b73afb052337d3c11d90efb5e90c2818063dda4d.tar.gz blogc-b73afb052337d3c11d90efb5e90c2818063dda4d.tar.bz2 blogc-b73afb052337d3c11d90efb5e90c2818063dda4d.zip  | |
content-parser: added more tests
| -rw-r--r-- | tests/check_content_parser.c | 15 | 
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/check_content_parser.c b/tests/check_content_parser.c index 048d2f2..fb56c19 100644 --- a/tests/check_content_parser.c +++ b/tests/check_content_parser.c @@ -1606,6 +1606,21 @@ test_content_parse_inline_image(void **state)      assert_non_null(html);      assert_string_equal(html, "<img src=\"http://example.org/\" alt=\"bola\">\n");      free(html); +    html = blogc_content_parse_inline( +        "[](https://blogc.rgm.io)"); +    assert_non_null(html); +    assert_string_equal(html, +        "<a href=\"https://blogc.rgm.io\"><img src=\"picture.jpg\" " +        "alt=\"This is the image alt text\"></a>"); +    free(html); +    html = blogc_content_parse_inline( +        "[![This is the image alt text]\n" +        "(picture.jpg)](https://blogc.rgm.io)"); +    assert_non_null(html); +    assert_string_equal(html, +        "<a href=\"https://blogc.rgm.io\"><img src=\"picture.jpg\" " +        "alt=\"This is the image alt text\"></a>"); +    free(html);      html = blogc_content_parse_inline("asd ![bola]chunda(1234)");      assert_non_null(html);      assert_string_equal(html, "asd ![bola]chunda(1234)");  | 
