diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-11-28 09:43:19 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-11-28 09:43:19 -0800 |
commit | 4ec2c47f71a94961fc85e02baa5a9f79feff7deb (patch) | |
tree | ab854f7e3fcb34c7983313885f2b7342bcc03a33 /api_test/cplusplus.cpp | |
parent | 572608d158772cef6562b8c34f370fff98855174 (diff) | |
parent | 1961ae06e96f1111f9c4316d9d08fc485008935f (diff) |
Merge pull request #221 from nwellnhof/cplusplus_test
Test that libcmark can be used by C++ code
Diffstat (limited to 'api_test/cplusplus.cpp')
-rw-r--r-- | api_test/cplusplus.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/api_test/cplusplus.cpp b/api_test/cplusplus.cpp new file mode 100644 index 0000000..ea64b06 --- /dev/null +++ b/api_test/cplusplus.cpp @@ -0,0 +1,15 @@ +#include <cstdlib> + +#include "cmark.h" + +#include "harness.h" + +extern "C" void +test_cplusplus(test_batch_runner *runner) +{ + static const char md[] = "paragraph\n"; + char *html = cmark_markdown_to_html(md, sizeof(md) - 1); + STR_EQ(runner, html, "<p>paragraph</p>\n", "libcmark works with C++"); + free(html); +} + |