]> git.mxchange.org Git - simgear.git/blob - simgear/misc/SimpleMarkdown_test.cxx
Simple Markdown parser.
[simgear.git] / simgear / misc / SimpleMarkdown_test.cxx
1 /// Unit tests for simple markdown parser
2 #define BOOST_TEST_MODULE misc
3 #include <BoostTestTargetConfig.h>
4
5 #include "SimpleMarkdown.hxx"
6
7 BOOST_AUTO_TEST_CASE( basic_markdown )
8 {
9   std::string const src(
10     "  \n"
11     "\n"
12     "blub\n"
13     "* \tlist item\n"
14     "*  another\t item\n"
15     "\n"
16     "test blubt\n"
17     " aha  \n"
18     "asd\n"
19     "  * 2nd list, another   item\n"
20     "  * 2nd list, one more..."
21   );
22   std::string const out(
23     "blub\n"
24     "\xE2\x80\xA2 list item\n"
25     "\xE2\x80\xA2 another item\n"
26     "\n"
27     "test blubt aha\n"
28     "asd\n"
29     "\xE2\x80\xA2 2nd list, another item\n"
30     "\xE2\x80\xA2 2nd list, one more..."
31   );
32
33   BOOST_CHECK_EQUAL(simgear::SimpleMarkdown::parse(src), out);
34 }