@@ -66,3 +66,24 @@ TEST_CASE ("Testing String::replace(String, String) substr 'find' smaller than '
66
66
str.replace (arduino::String (" ll" ), arduino::String (" 111" ));
67
67
REQUIRE (str == " He111o Arduino!" );
68
68
}
69
+
70
+ TEST_CASE (" Testing String::replace(String, String) substr 'find' smaller than 'replace' multiple occurencies" , " [String-replace-08]" )
71
+ {
72
+ arduino::String str (" Hello Arduino! Hello, Hello, Hello" );
73
+ str.replace (arduino::String (" ll" ), arduino::String (" lll" ));
74
+ REQUIRE (str == " Helllo Arduino! Helllo, Helllo, Helllo" );
75
+ }
76
+
77
+ TEST_CASE (" Testing String::replace(String, String) substr 'find' same length as 'replace' multiple occurencies" , " [String-replace-09]" )
78
+ {
79
+ arduino::String str (" Hello Arduino! Hello, Hello, Hello" );
80
+ str.replace (arduino::String (" ll" ), arduino::String (" 11" ));
81
+ REQUIRE (str == " He11o Arduino! He11o, He11o, He11o" );
82
+ }
83
+
84
+ TEST_CASE (" Testing String::replace(String, String) substr 'find' larger than 'replace' multiple occurencies" , " [String-replace-10]" )
85
+ {
86
+ arduino::String str (" Helllo Arduino! Helllo, Helllo, Helllo" );
87
+ str.replace (arduino::String (" lll" ), arduino::String (" ll" ));
88
+ REQUIRE (str == " Hello Arduino! Hello, Hello, Hello" );
89
+ }
0 commit comments