1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-29 16:16:38 +00:00

Fix crash caused by trailing spaces

This commit is contained in:
Julian
2025-03-08 11:56:40 -05:00
parent b5bdb88062
commit 659d1b5d0c
5 changed files with 24 additions and 8 deletions

View File

@@ -713,6 +713,14 @@ TEST_CASE("[String] Splitting") {
CHECK(l[i] == slices[i]);
}
}
{
const String s = "Mars Jupiter Saturn Uranus";
const char *slices[2] = { "Mars", "Jupiter Saturn Uranus" };
Vector<String> l = s.split_spaces(1);
for (int i = 0; i < l.size(); i++) {
CHECK(l[i] == slices[i]);
}
}
{
const String s = "1.2;2.3 4.5";