solidity/test/libsolidity/semanticTests/strings/concat/string_concat_empty_strings.sol

28 lines
672 B
Solidity
Raw Normal View History

contract C {
function f() public returns (string memory) {
string memory b = "";
return string.concat(
string.concat(b),
string.concat(b, b),
string.concat("", b),
string.concat(b, "")
);
}
function g() public returns (string memory) {
return string.concat("", "abc", hex"", "abc", unicode"");
}
function h() public returns (string memory) {
string memory b = "";
return string.concat(b, "abc", b, "abc", b);
}
}
// ====
// compileToEwasm: also
// compileViaYul: also
// ----
// f() -> 0x20, 0
// g() -> 0x20, 6, "abcabc"
// h() -> 0x20, 6, "abcabc"