Some repairs for md_parser and template engine.
This commit is contained in:
parent
8705859115
commit
22157169c0
14 changed files with 180 additions and 159 deletions
|
@ -1,15 +1,29 @@
|
|||
#include "TemplatingEngine.h"
|
||||
#include "TemplateSubstitutionContext.h"
|
||||
|
||||
#include "File.h"
|
||||
|
||||
#include "TestFramework.h"
|
||||
#include "TestUtils.h"
|
||||
|
||||
TEST_CASE(TestTemplatingEngine, "compiler")
|
||||
TEST_CASE(TestTemplatingEngine_BlockInherit, "compiler")
|
||||
{
|
||||
auto engine = TemplatingEngine(TestUtils::getTestDataDir());
|
||||
const auto content = engine.renderTemplate("index", nullptr);
|
||||
|
||||
File outfile(TestUtils::getTestOutputDir() / "index.html");
|
||||
File outfile(TestUtils::getTestOutputDir(__FILE__) / "BlockInherit.html");
|
||||
outfile.writeText(content);
|
||||
}
|
||||
|
||||
TEST_CASE(TestTemplatingEngine_Simple, "compiler")
|
||||
{
|
||||
auto engine = TemplatingEngine(TestUtils::getTestDataDir());
|
||||
|
||||
TemplateSubstitutionContext sub_context;
|
||||
sub_context.addSubstitution("content", "<div><p>test</p></div>");
|
||||
|
||||
const auto content = engine.renderTemplate("simple_template", &sub_context);
|
||||
|
||||
File outfile(TestUtils::getTestOutputDir(__FILE__) / "Simple.html");
|
||||
outfile.writeText(content);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue