summaryrefslogtreecommitdiff
path: root/api_test/cplusplus.cpp
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2014-11-28 15:36:19 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2014-11-28 15:40:35 +0100
commit1961ae06e96f1111f9c4316d9d08fc485008935f (patch)
treeab854f7e3fcb34c7983313885f2b7342bcc03a33 /api_test/cplusplus.cpp
parent572608d158772cef6562b8c34f370fff98855174 (diff)
Test that libcmark can be used by C++ code
Diffstat (limited to 'api_test/cplusplus.cpp')
-rw-r--r--api_test/cplusplus.cpp15
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);
+}
+