diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/string/test_string.h | 2 | ||||
-rw-r--r-- | tests/create_test.py | 2 | ||||
-rw-r--r-- | tests/python_build/test_gles3_builder.py | 6 | ||||
-rw-r--r-- | tests/python_build/test_glsl_builder.py | 6 |
4 files changed, 9 insertions, 7 deletions
diff --git a/tests/core/string/test_string.h b/tests/core/string/test_string.h index 027dcac92d..64f03e5879 100644 --- a/tests/core/string/test_string.h +++ b/tests/core/string/test_string.h @@ -338,10 +338,12 @@ TEST_CASE("[String] Natural compare function test") { TEST_CASE("[String] File compare function test") { String a = "_img2.png"; + String b = "img2.png"; CHECK(a.nocasecmp_to("img10.png") > 0); CHECK_MESSAGE(a.filenocasecmp_to("img10.png") < 0, "Should sort before letters."); CHECK_MESSAGE(a.filenocasecmp_to(".img10.png") > 0, "Should sort after period."); + CHECK(b.filenocasecmp_to("img3.png") < 0); } TEST_CASE("[String] hex_encode_buffer") { diff --git a/tests/create_test.py b/tests/create_test.py index 4d1f1d656e..deb53aca20 100644 --- a/tests/create_test.py +++ b/tests/create_test.py @@ -101,7 +101,7 @@ TEST_CASE("[{name_pascal_case}] Example test case") {{ if args.invasive: print("Trying to insert include directive in test_main.cpp...") - with open("test_main.cpp", "r") as file: + with open("test_main.cpp", "r", encoding="utf-8") as file: contents = file.read() match = re.search(r'#include "tests.*\n', contents) diff --git a/tests/python_build/test_gles3_builder.py b/tests/python_build/test_gles3_builder.py index 861e0b84c4..6f16139eb9 100644 --- a/tests/python_build/test_gles3_builder.py +++ b/tests/python_build/test_gles3_builder.py @@ -17,15 +17,15 @@ def test_gles3_builder(shader_files, builder, header_struct): builder(shader_files["path_input"], "drivers/gles3/shader_gles3.h", "GLES3", header_data=header) - with open(shader_files["path_expected_parts"], "r") as f: + with open(shader_files["path_expected_parts"], "r", encoding="utf-8") as f: expected_parts = json.load(f) assert expected_parts == header.__dict__ - with open(shader_files["path_output"], "r") as f: + with open(shader_files["path_output"], "r", encoding="utf-8") as f: actual_output = f.read() assert actual_output - with open(shader_files["path_expected_full"], "r") as f: + with open(shader_files["path_expected_full"], "r", encoding="utf-8") as f: expected_output = f.read() assert actual_output == expected_output diff --git a/tests/python_build/test_glsl_builder.py b/tests/python_build/test_glsl_builder.py index b9dcef48ac..348ef8441c 100644 --- a/tests/python_build/test_glsl_builder.py +++ b/tests/python_build/test_glsl_builder.py @@ -23,15 +23,15 @@ def test_glsl_builder(shader_files, builder, header_struct): header = header_struct() builder(shader_files["path_input"], header_data=header) - with open(shader_files["path_expected_parts"], "r") as f: + with open(shader_files["path_expected_parts"], "r", encoding="utf-8") as f: expected_parts = json.load(f) assert expected_parts == header.__dict__ - with open(shader_files["path_output"], "r") as f: + with open(shader_files["path_output"], "r", encoding="utf-8") as f: actual_output = f.read() assert actual_output - with open(shader_files["path_expected_full"], "r") as f: + with open(shader_files["path_expected_full"], "r", encoding="utf-8") as f: expected_output = f.read() assert actual_output == expected_output |