From b1859510ab0a3381e0a5bec3d896032fc5019147 Mon Sep 17 00:00:00 2001 From: Tomasz Chabora Date: Thu, 13 Feb 2020 16:42:49 +0100 Subject: Change behavior of String.right --- tests/test_string.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/test_string.h') 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") { -- cgit v1.2.3