From 19dc42649183b2e1cd37be1ca69145dafe1330a2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 3 May 2019 22:19:55 +0300 Subject: Add implementation --- libcmark-gfm/tests/basic/buildfile | 7 +++++++ libcmark-gfm/tests/basic/driver.c | 28 ++++++++++++++++++++++++++++ libcmark-gfm/tests/basic/testscript | 5 +++++ 3 files changed, 40 insertions(+) create mode 100644 libcmark-gfm/tests/basic/buildfile create mode 100644 libcmark-gfm/tests/basic/driver.c create mode 100644 libcmark-gfm/tests/basic/testscript (limited to 'libcmark-gfm/tests/basic') diff --git a/libcmark-gfm/tests/basic/buildfile b/libcmark-gfm/tests/basic/buildfile new file mode 100644 index 0000000..3f72c2d --- /dev/null +++ b/libcmark-gfm/tests/basic/buildfile @@ -0,0 +1,7 @@ +# file : tests/basic/buildfile +# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd +# license : FreeBSD License; see accompanying COPYING file + +import libs = libcmark-gfm%lib{cmark-gfm} + +exe{driver}: {h c}{**} $libs testscript diff --git a/libcmark-gfm/tests/basic/driver.c b/libcmark-gfm/tests/basic/driver.c new file mode 100644 index 0000000..e38e03a --- /dev/null +++ b/libcmark-gfm/tests/basic/driver.c @@ -0,0 +1,28 @@ +/* + * file : tests/basic/driver.c + * copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC + * license : FreeBSD License; see accompanying COPYING file + */ + +#include +#include +#include + +#include +#include + +int +main (int argc, const char* argv[]) +{ + assert (argc == 2); + + const char* from = argv[1]; + + char* to = cmark_markdown_to_html (from, + strlen (from), + CMARK_OPT_DEFAULT | + CMARK_OPT_VALIDATE_UTF8); + printf ("%s", to); + cmark_get_default_mem_allocator ()->free (to); + return 0; +} diff --git a/libcmark-gfm/tests/basic/testscript b/libcmark-gfm/tests/basic/testscript new file mode 100644 index 0000000..41b7d26 --- /dev/null +++ b/libcmark-gfm/tests/basic/testscript @@ -0,0 +1,5 @@ +# file : tests/basic/testscript +# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd +# license : FreeBSD License; see accompanying COPYING file + +$* 'Hello *world*' >'

Hello world

' -- cgit v1.1