diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-15 18:14:38 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-15 18:14:38 +0200 |
commit | 684e7aa37a134afe0c6c9a5db252e64d5c3afd42 (patch) | |
tree | 705852b7ebc9f174d888468c6da23d11d7ece994 /modules/gdscript/tests/gdscript_test_runner.cpp | |
parent | 49dd453ca7e2b63beecf84346a4938b6f1240899 (diff) | |
parent | 02253b6b91472e251418bd0545afb2b653b5385c (diff) | |
download | redot-engine-684e7aa37a134afe0c6c9a5db252e64d5c3afd42.tar.gz |
Merge pull request #89472 from dalexeev/gds-fix-bin-tokenizer-continuation-lines
GDScript: Fix continuation lines in `GDScriptTokenizerBuffer`
Diffstat (limited to 'modules/gdscript/tests/gdscript_test_runner.cpp')
-rw-r--r-- | modules/gdscript/tests/gdscript_test_runner.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/modules/gdscript/tests/gdscript_test_runner.cpp b/modules/gdscript/tests/gdscript_test_runner.cpp index a0329eb8d2..e3d16eaf42 100644 --- a/modules/gdscript/tests/gdscript_test_runner.cpp +++ b/modules/gdscript/tests/gdscript_test_runner.cpp @@ -300,14 +300,23 @@ bool GDScriptTestRunner::make_tests_for_dir(const String &p_dir) { #endif String out_file = next.get_basename() + ".out"; - if (!is_generating && !dir->file_exists(out_file)) { - ERR_FAIL_V_MSG(false, "Could not find output file for " + next); - } - GDScriptTest test(current_dir.path_join(next), current_dir.path_join(out_file), source_dir); - if (binary_tokens) { - test.set_tokenizer_mode(GDScriptTest::TOKENIZER_BUFFER); + ERR_FAIL_COND_V_MSG(!is_generating && !dir->file_exists(out_file), false, "Could not find output file for " + next); + + if (next.ends_with(".bin.gd")) { + // Test text mode first. + GDScriptTest text_test(current_dir.path_join(next), current_dir.path_join(out_file), source_dir); + tests.push_back(text_test); + // Test binary mode even without `--use-binary-tokens`. + GDScriptTest bin_test(current_dir.path_join(next), current_dir.path_join(out_file), source_dir); + bin_test.set_tokenizer_mode(GDScriptTest::TOKENIZER_BUFFER); + tests.push_back(bin_test); + } else { + GDScriptTest test(current_dir.path_join(next), current_dir.path_join(out_file), source_dir); + if (binary_tokens) { + test.set_tokenizer_mode(GDScriptTest::TOKENIZER_BUFFER); + } + tests.push_back(test); } - tests.push_back(test); } } |