Skip to content

Commit e83ce70

Browse files
committed
Add test code for String::concat(const __FlashStringHelper *)
1 parent b59d22c commit e83ce70

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/src/String/test_concat.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,11 @@ TEST_CASE ("Testing String::concat(double)", "[String-concat-10]")
9191
REQUIRE(str.concat(num) == 1);
9292
REQUIRE(strcmp(str.c_str(), "Hello 5.68") == 0);
9393
}
94+
95+
TEST_CASE ("Testing String::concat(const __FlashStringHelper *)", "[String-concat-11]")
96+
{
97+
#undef F
98+
#define F(string_literal) (reinterpret_cast<const arduino::__FlashStringHelper *>(PSTR(string_literal)))
99+
arduino::String str1("Hello");
100+
REQUIRE(str1.concat(F(" Arduino")) == 1);
101+
}

0 commit comments

Comments
 (0)