This commit is contained in:
Masato Nakasaka 2026-03-16 09:34:42 +09:00 committed by GitHub
commit a005fbf52e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -1897,6 +1897,9 @@ import sys
from datetime import datetime
from jinja2.sandbox import SandboxedEnvironment
# Force LF print even on Windows so test results match expected
sys.stdout.reconfigure(newline="\n")
tmpl = json.loads(sys.argv[1])
vars_json = json.loads(sys.argv[2])
@ -1921,8 +1924,9 @@ print(result, end='')
static void test_template_py(testing & t, const std::string & name, const std::string & tmpl, const json & vars, const std::string & expect) {
t.test(name, [&tmpl, &vars, &expect](testing & t) {
// Prepare arguments
std::string tmpl_json = json(tmpl).dump();
std::string vars_json = vars.dump();
// Force Ascii only JSON to prevent mismatch on Windows
std::string tmpl_json = json(tmpl).dump(-1, ' ', true);
std::string vars_json = vars.dump(-1, ' ', true);
#ifdef _WIN32
const char * python_executable = "python.exe";