Clean up some tests.
This commit is contained in:
parent
b17ba8b3a7
commit
c102ebb6da
64 changed files with 615 additions and 541 deletions
|
@ -3,23 +3,21 @@
|
|||
#include "HtmlWriter.h"
|
||||
|
||||
#include "TestFramework.h"
|
||||
#include "TestUtils.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();
|
||||
File md_file(TestUtils::getTestDataDir() / "sample_markdown.md");
|
||||
const auto md_content = md_file.readText();
|
||||
|
||||
MarkdownParser parser;
|
||||
parser.Run(md_content);
|
||||
parser.run(md_content);
|
||||
|
||||
auto html = parser.GetHtml();
|
||||
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);
|
||||
File html_file(TestUtils::getTestOutputDir() / "TestMarkdownParserOut.html");
|
||||
html_file.writeText(html_string);
|
||||
}
|
||||
|
|
|
@ -6,13 +6,14 @@
|
|||
#include "File.h"
|
||||
|
||||
#include "TestFramework.h"
|
||||
#include "TestUtils.h"
|
||||
|
||||
TEST_CASE(TestXmlParser, "web")
|
||||
{
|
||||
XmlParser parser;
|
||||
|
||||
std::ifstream xml_file;
|
||||
xml_file.open("/home/jmsgrogan/test.xml", std::ifstream::in);
|
||||
xml_file.open(TestUtils::getTestDataDir() / "test.xml", std::ifstream::in);
|
||||
while(xml_file.good())
|
||||
{
|
||||
std::string line;
|
||||
|
@ -21,11 +22,9 @@ TEST_CASE(TestXmlParser, "web")
|
|||
}
|
||||
xml_file.close();
|
||||
|
||||
auto outFile = std::make_unique<File>("test_out.xml");
|
||||
outFile->SetAccessMode(File::AccessMode::Write);
|
||||
outFile->Open();
|
||||
|
||||
XmlWriter writer;
|
||||
auto content = writer.ToString(parser.GetDocument().get());
|
||||
outFile->WriteText(content);
|
||||
|
||||
auto outFile = std::make_unique<File>(TestUtils::getTestOutputDir() / "test_out.xml");
|
||||
outFile->writeText(content);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue