diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-09 22:20:23 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-09 22:20:23 +0100 |
commit | 0ace0a129284ffc6646b199699c1607a316fcec0 (patch) | |
tree | 82c37d0f9c972396d0031fc757a33fc35576af5d /tests/create_test.py | |
parent | 7d6ae138fa7064270ee61fed747a11780c2f1c0f (diff) | |
parent | d9fa40f2df44d775e82332577d44de402b23611f (diff) | |
download | redot-engine-0ace0a129284ffc6646b199699c1607a316fcec0.tar.gz |
Merge pull request #89333 from Repiteo/enforce-eol-python
Enforce `\n` eol for Python writes
Diffstat (limited to 'tests/create_test.py')
-rw-r--r-- | tests/create_test.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/create_test.py b/tests/create_test.py index 867a66e446..4d1f1d656e 100644 --- a/tests/create_test.py +++ b/tests/create_test.py @@ -38,7 +38,7 @@ def main(): if os.path.isfile(file_path): print(f'ERROR: The file "{file_path}" already exists.') sys.exit(1) - with open(file_path, "w") as file: + with open(file_path, "w", encoding="utf-8", newline="\n") as file: file.write( """/**************************************************************************/ /* test_{name_snake_case}.h {padding} */ @@ -108,7 +108,7 @@ TEST_CASE("[{name_pascal_case}] Example test case") {{ if match: new_string = contents[: match.start()] + f'#include "tests/{file_path}"\n' + contents[match.start() :] - with open("test_main.cpp", "w") as file: + with open("test_main.cpp", "w", encoding="utf-8", newline="\n") as file: file.write(new_string) print("Done.") # Use clang format to sort include directives afster insertion. |