mirror of
https://github.com/pantor/inja.git
synced 2026-06-03 17:39:46 +00:00
fix write file bug and readme
This commit is contained in:
@@ -59,10 +59,6 @@ add_custom_command(
|
||||
${CMAKE_SOURCE_DIR}/test/data
|
||||
${CMAKE_CURRENT_BINARY_DIR}/data
|
||||
)
|
||||
add_custom_target(
|
||||
build-time-make-directory ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/results
|
||||
)
|
||||
##
|
||||
## Add tests to make
|
||||
##
|
||||
|
||||
@@ -46,12 +46,12 @@ TEST_CASE("global-path") {
|
||||
}
|
||||
|
||||
TEST_CASE("input-output-path") {
|
||||
inja::Environment env = inja::Environment("data/", "results/");
|
||||
inja::Environment env = inja::Environment("data/", "data/");
|
||||
json data;
|
||||
data["name"] = "Jeff";
|
||||
|
||||
SECTION("Files should be written") {
|
||||
env.write("simple.txt", data, "result.txt");
|
||||
CHECK( env.load_global_file("../results/result.txt") == "Hello Jeff." );
|
||||
env.write("simple.txt", data, "simple-result.txt");
|
||||
CHECK( env.load_global_file("simple-result.txt") == "Hello Jeff." );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user