2 #include <gtest/gtest.h>
7 // The fixture for testing paths functions.
8 class MarkdownTest : public testing::Test
11 // You can remove any or all of the following functions if its body
16 // You can do set-up work for each test here.
19 virtual ~MarkdownTest()
21 // You can do clean-up work that doesn't throw exceptions here.
24 // If the constructor and destructor are not enough for setting up
25 // and cleaning up each test, you can define the following methods:
29 // Code here will be called immediately after the constructor (right
33 virtual void TearDown()
35 // Code here will be called immediately after each test (right
36 // before the destructor).
39 // Objects declared here can be used by all tests in the test case for Foo.
42 TEST_F(MarkdownTest, MarkdownTest1)
45 _T("<!DOCTYPE html>\r\n")
48 _T("<meta charset=\"UTF-8\">\r\n")
49 _T("<title>HTML5</title>\r\n")
52 _T("<div id='abc'>HTML5 test</div>\r\n")
56 CMarkdown::File fi(html.c_str(), html.length() * sizeof(TCHAR), CMarkdown::Html|CMarkdown::FileImage::Mapping|CMarkdown::FileImage::Octets);
58 EXPECT_EQ("meta", fi.GetTagName());
59 std::string content = fi.GetAttribute("context");
60 EXPECT_EQ("", content);
61 std::string charset = fi.GetAttribute("charset");
62 EXPECT_EQ("UTF-8", charset);
64 CMarkdown &pt = fi.Move("div");
65 EXPECT_EQ("div", pt.GetTagName());
66 EXPECT_EQ("div id='abc'", pt.GetTagText());
67 EXPECT_EQ("<div id='abc'>HTML5 test</div>", pt.GetOuterText());
68 EXPECT_EQ("HTML5 test", pt.GetInnerText());