summaryrefslogtreecommitdiff
path: root/tests/test_string.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-05-20 23:56:17 +0200
committerGitHub <noreply@github.com>2021-05-20 23:56:17 +0200
commitbfe4af91a26787c11c3d4c84a216d6d728322035 (patch)
treeb6c994cc1c4226f9c45b3e2d0e2b467a657b7bc1 /tests/test_string.h
parent98071ec136bad8ede5f8c0505e6cff6f33f787ef (diff)
parentb1859510ab0a3381e0a5bec3d896032fc5019147 (diff)
Merge pull request #36180 from KoBeWi/I_broke_your_right
Change behavior of String.right
Diffstat (limited to 'tests/test_string.h')
-rw-r--r--tests/test_string.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_string.h b/tests/test_string.h
index 486c17dbbd..6e214574af 100644
--- a/tests/test_string.h
+++ b/tests/test_string.h
@@ -299,6 +299,7 @@ TEST_CASE("[String] hex_encode_buffer") {
TEST_CASE("[String] Substr") {
String s = "Killer Baby";
CHECK(s.substr(3, 4) == "ler ");
+ CHECK(s.substr(3) == "ler Baby");
}
TEST_CASE("[String] Find") {
@@ -1252,8 +1253,10 @@ TEST_CASE("[String] Trim") {
TEST_CASE("[String] Right/Left") {
String s = "aaaTestbbb";
// ^
- CHECK(s.right(6) == "tbbb");
+ CHECK(s.right(6) == "estbbb");
+ CHECK(s.right(-6) == "tbbb");
CHECK(s.left(6) == "aaaTes");
+ CHECK(s.left(-6) == "aaaT");
}
TEST_CASE("[String] Repeat") {