summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSilicDev <83308290+SilicDev@users.noreply.github.com>2023-03-30 15:45:45 +0200
committerSilicDev <83308290+SilicDev@users.noreply.github.com>2023-05-04 00:52:35 +0200
commit6fa4f71ca686e68667f61185dcbe4ebb0f64af06 (patch)
treec951a82c9a481bad1cea96e81075f2760bdf697e /tests
parent49a196277f86977d08cc10b6bb878427ae54a964 (diff)
downloadredot-engine-6fa4f71ca686e68667f61185dcbe4ebb0f64af06.tar.gz
Reimplement String.erase
Diffstat (limited to 'tests')
-rw-r--r--tests/core/string/test_string.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/core/string/test_string.h b/tests/core/string/test_string.h
index 5d19b5a164..036daf13f8 100644
--- a/tests/core/string/test_string.h
+++ b/tests/core/string/test_string.h
@@ -395,6 +395,12 @@ TEST_CASE("[String] Insertion") {
CHECK(s == "Who is Frederic Chopin?");
}
+TEST_CASE("[String] Erasing") {
+ String s = "Josephine is such a cute girl!";
+ s = s.erase(s.find("cute "), String("cute ").length());
+ CHECK(s == "Josephine is such a girl!");
+}
+
TEST_CASE("[String] Number to string") {
CHECK(String::num(0) == "0");
CHECK(String::num(0.0) == "0"); // No trailing zeros.