stuff-from-scratch/test/web/TestMarkdownParser.cpp
2022-11-29 18:00:19 +00:00

25 lines
621 B
C++

#include "MarkdownParser.h"
#include "File.h"
#include "HtmlWriter.h"
#include "TestFramework.h"
TEST_CASE(TestMarkdownParser, "web")
{
File md_file("/home/jmsgrogan/code/MediaTool/test/data/sample_markdown.md");
md_file.Open();
const auto md_content = md_file.ReadText();
MarkdownParser parser;
parser.Run(md_content);
auto html = parser.GetHtml();
HtmlWriter writer;
const auto html_string = writer.ToString(html);
File html_file("TestMarkdownParserOut.html");
html_file.SetAccessMode(File::AccessMode::Write);
html_file.Open();
html_file.WriteText(html_string);
}