Skip to content

Commit e4febf7

Browse files
committed
Add test code to complete coverage of String::replace(const String& find, const String& replace)
1 parent c3e155c commit e4febf7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/src/String/test_replace.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,12 @@ TEST_CASE ("Testing String::replace(String, String) when string constains subtr
5050
str.replace(arduino::String("ll"), arduino::String("11"));
5151
REQUIRE(strcmp(str.c_str(), "He11o Arduino!") == 0);
5252
}
53+
54+
TEST_CASE ("Testing String::replace(String, String) substr 'find' smaller than 'replace'", "[String-replace-06]")
55+
{
56+
arduino::String str("Hello Arduino!");
57+
str.replace(arduino::String("ll"), arduino::String("111"));
58+
REQUIRE(strcmp(str.c_str(), "He111o Arduino!") == 0);
59+
//REQUIRE(strcmp("He11 Arduino!", "He11 Arduino!") == 0);
60+
//REQUIRE(str.startsWith("Hel1o") == 0);
61+
}

0 commit comments

Comments
 (0)