Skip to content

Commit 1891605

Browse files
committed
Add new test code for 'find' len higher than 'replace' len
1 parent 411e44a commit 1891605

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/src/String/test_replace.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ TEST_CASE ("Testing String::replace(String, String) when string constains subtr
5151
REQUIRE(strcmp(str.c_str(), "He11o Arduino!") == 0);
5252
}
5353

54-
TEST_CASE ("Testing String::replace(String, String) substr 'find' smaller than 'replace'", "[String-replace-06]")
54+
TEST_CASE ("Testing String::replace(String, String) substr 'find' larger than 'replace'", "[String-replace-06]")
55+
{
56+
arduino::String str("Hello Arduino!");
57+
str.replace(arduino::String("llo"), arduino::String("11"));
58+
REQUIRE(strcmp(str.c_str(), "He11 Arduino!") == 0);
59+
}
60+
61+
TEST_CASE ("Testing String::replace(String, String) substr 'find' smaller than 'replace'", "[String-replace-07]")
5562
{
5663
arduino::String str("Hello Arduino!");
5764
str.replace(arduino::String("ll"), arduino::String("111"));

0 commit comments

Comments
 (0)