diff options
Diffstat (limited to 'libcmark-gfm/tests/basic')
-rw-r--r-- | libcmark-gfm/tests/basic/buildfile | 7 | ||||
-rw-r--r-- | libcmark-gfm/tests/basic/driver.c | 28 | ||||
-rw-r--r-- | libcmark-gfm/tests/basic/testscript | 5 |
3 files changed, 40 insertions, 0 deletions
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 <stdio.h> +#include <string.h> +#include <assert.h> + +#include <cmark-gfm.h> +#include <cmark-gfm-extension_api.h> + +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*' >'<p>Hello <em>world</em></p>' |