stuff-from-scratch/test/web/TestMarkdownParser.cpp

26 lines
621 B
C++
Raw Normal View History

2022-01-01 18:46:31 +00:00
#include "MarkdownParser.h"
#include "File.h"
#include "HtmlWriter.h"
2022-11-29 18:00:19 +00:00
#include "TestFramework.h"
TEST_CASE(TestMarkdownParser, "web")
2022-01-01 18:46:31 +00:00
{
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);
}