diff options
Diffstat (limited to 'main/tests/test_string.cpp')
-rw-r--r-- | main/tests/test_string.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp index 511646db0a..dcbb930d1b 100644 --- a/main/tests/test_string.cpp +++ b/main/tests/test_string.cpp @@ -457,7 +457,7 @@ bool test_27() { state = s.begins_with(sb) == tc[i].expected; } if (!state) { - OS::get_singleton()->print("\n\t Failure on:\n\t\tstring: ", tc[i].data, "\n\t\tbegin: ", tc[i].begin, "\n\t\texpected: ", tc[i].expected ? "true" : "false", "\n"); + OS::get_singleton()->print("\n\t Failure on:\n\t\tstring: %s\n\t\tbegin: %s\n\t\texpected: %s\n", tc[i].data, tc[i].begin, tc[i].expected ? "true" : "false"); break; } }; @@ -1046,6 +1046,26 @@ bool test_32() { #undef STRIP_TEST } +bool test_33() { + OS::get_singleton()->print("\n\nTest 33: parse_utf8(null, -1)\n"); + + String empty; + return empty.parse_utf8(NULL, -1) == true; +} + +bool test_34() { + OS::get_singleton()->print("\n\nTest 34: Cyrillic to_lower()\n"); + + String upper = L"АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ"; + String lower = L"абвгдеёжзийклмнопрстуфхцчшщъыьэюя"; + + String test = upper.to_lower(); + + bool state = test == lower; + + return state; +} + typedef bool (*TestFunc)(void); TestFunc test_funcs[] = { @@ -1082,6 +1102,8 @@ TestFunc test_funcs[] = { test_30, test_31, test_32, + test_33, + test_34, 0 }; |