Skip to content

Commit 5af3256

Browse files
committed
Add test case for & String::operator = (StringSumHelper &&rval)
1 parent 105a180 commit 5af3256

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/src/String/test_operators.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,17 @@ TEST_CASE ("Testing String::operator + (const __FlashStringHelper *)", "[String-
9999
arduino::String str1("Hello ");
100100
arduino::String str("Hello Arduino");
101101
REQUIRE(str.compareTo(str1+F("Arduino")) == 0);
102+
}
103+
104+
TEST_CASE ("Testing & String::operator = (StringSumHelper &&rval)", "[String-operator+-12]")
105+
{
106+
arduino::String str1("Hello ");
107+
arduino::String str = (str1+"Arduino");
108+
REQUIRE(str.compareTo("Hello Arduino") == 0);
109+
/*
110+
arduino::String str1;
111+
char ch='!';
112+
arduino::String str = (str1+ch);
113+
REQUIRE(str.compareTo("Hello!") == 0);
114+
*/
102115
}

0 commit comments

Comments
 (0)