mirror of
https://github.com/pantor/inja.git
synced 2026-03-28 11:52:49 +00:00
Fix: Remove circular dependencies in headers (#295)
* Remove circular dependencies in headers * Fix unit test includes and test data directory location
This commit is contained in:
committed by
GitHub
parent
17ba53cb9e
commit
384a6bef3f
@@ -1,9 +1,8 @@
|
||||
// Copyright (c) 2020 Pantor. All rights reserved.
|
||||
|
||||
#include <doctest/doctest.h>
|
||||
|
||||
#include "inja/environment.hpp"
|
||||
#include "inja/inja.hpp"
|
||||
|
||||
#include "test-common.hpp"
|
||||
|
||||
TEST_CASE("loading") {
|
||||
inja::Environment env;
|
||||
@@ -99,7 +98,8 @@ TEST_CASE("include-in-memory-and-file-template") {
|
||||
inja::json data;
|
||||
data["name"] = "Jeff";
|
||||
|
||||
CHECK_THROWS_WITH(env.render_file("include-both.txt", data), "[inja.exception.file_error] failed accessing file at '../test/data/body'");
|
||||
std::string error_message = "[inja.exception.file_error] failed accessing file at '" + test_file_directory + "body'";
|
||||
CHECK_THROWS_WITH(env.render_file("include-both.txt", data), error_message.c_str());
|
||||
|
||||
const auto parsed_body_template = env.parse("Bye {{ name }}.");
|
||||
env.include_template("body", parsed_body_template);
|
||||
|
||||
Reference in New Issue
Block a user