diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-23 16:14:08 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-23 16:14:08 +0200 |
commit | 4254946de93bab0cc1fb36a7b9039c9ec43be924 (patch) | |
tree | 7c20e9d89ccfdd1e48c50a969b9ea828e562f3cf /tests | |
parent | 2017006879833d346a967dc8fcce4b846a8ed1c6 (diff) | |
parent | a751c05b15e75904cc949934f95061f1c0ee40e4 (diff) | |
download | redot-engine-4254946de93bab0cc1fb36a7b9039c9ec43be924.tar.gz |
Merge pull request #97323 from timothyqiu/drop-unicode-identifier
Fix script editor wrongly replaces and quotes non-ASCII letters
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/string/test_string.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/core/string/test_string.h b/tests/core/string/test_string.h index a9f615af84..301771a3de 100644 --- a/tests/core/string/test_string.h +++ b/tests/core/string/test_string.h @@ -1888,7 +1888,7 @@ TEST_CASE("[String] validate_node_name") { CHECK(name_with_invalid_chars.validate_node_name() == "Name with invalid characters ____removed!"); } -TEST_CASE("[String] validate_identifier") { +TEST_CASE("[String] validate_ascii_identifier") { String empty_string; CHECK(empty_string.validate_ascii_identifier() == "_"); @@ -1902,6 +1902,20 @@ TEST_CASE("[String] validate_identifier") { CHECK(name_with_invalid_chars.validate_ascii_identifier() == "Invalid_characters_______"); } +TEST_CASE("[String] validate_unicode_identifier") { + String empty_string; + CHECK(empty_string.validate_unicode_identifier() == "_"); + + String numeric_only = "12345"; + CHECK(numeric_only.validate_unicode_identifier() == "_12345"); + + String name_with_spaces = "Name with spaces"; + CHECK(name_with_spaces.validate_unicode_identifier() == "Name_with_spaces"); + + String name_with_invalid_chars = U"Invalid characters:@*#&世界"; + CHECK(name_with_invalid_chars.validate_unicode_identifier() == U"Invalid_characters_____世界"); +} + TEST_CASE("[String] Variant indexed get") { Variant s = String("abcd"); bool valid = false; |