summaryrefslogtreecommitdiff
path: root/api_test/main.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-07-03 12:02:29 -0700
committerGitHub <noreply@github.com>2016-07-03 12:02:29 -0700
commit7ae67bd161aa267aa540d30a6683a365f64bef3a (patch)
tree1a687a13d0d38317f9021054c6194038bd1e9a63 /api_test/main.c
parent3d6155fe9a49e4a07379b816f9c7c2f00ae33dc4 (diff)
parent67f760a78f7a875216d9b64aaf3524cc4f9a0f48 (diff)
Merge pull request #140 from nwellnhof/set-cstr-fix
Fix chunk_set_cstr with suffix of current string
Diffstat (limited to 'api_test/main.c')
-rw-r--r--api_test/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/api_test/main.c b/api_test/main.c
index 8da9ba9..94051e9 100644
--- a/api_test/main.c
+++ b/api_test/main.c
@@ -171,7 +171,13 @@ static void accessors(test_batch_runner *runner) {
OK(runner, cmark_node_set_url(link, "URL"), "set_url");
OK(runner, cmark_node_set_title(link, "TITLE"), "set_title");
- OK(runner, cmark_node_set_literal(string, "LINK"), "set_literal string");
+ OK(runner, cmark_node_set_literal(string, "prefix-LINK"),
+ "set_literal string");
+
+ // Set literal to suffix of itself (issue #139).
+ const char *literal = cmark_node_get_literal(string);
+ OK(runner, cmark_node_set_literal(string, literal + sizeof("prefix")),
+ "set_literal suffix");
char *rendered_html = cmark_render_html(doc, CMARK_OPT_DEFAULT);
static const char expected_html[] =