Update tests for unicode literals

This commit is contained in:
Alex Beregszaszi
2020-07-27 18:21:17 +01:00
parent 6eb60bc8cd
commit f5f86779b8
18 changed files with 676 additions and 15 deletions
@@ -1,3 +1,4 @@
contract C {
string s = "\xf0\x9f\xa6\x84";
}
// ----
@@ -0,0 +1,9 @@
contract test {
function f() public pure returns (string memory) {
return "hello world";
}
function g() public pure returns (string memory) {
return unicode"hello world";
}
}
// ----
@@ -0,0 +1,7 @@
contract test {
function f() public pure returns (bytes32) {
bytes32 escapeCharacters = unicode"foo" unicode"😃, 😭, and 😈" unicode"!";
return escapeCharacters;
}
}
// ----
@@ -0,0 +1,8 @@
contract test {
function f() public pure returns (bytes32) {
bytes32 escapeCharacters = "foo" hex"aa" unicode"😃, 😭, and 😈" "!" hex"00";
return escapeCharacters;
}
}
// ----
// ParserError 2314: (106-113): Expected ';' but got 'HexStringLiteral'
@@ -1,7 +1,6 @@
contract test {
function f() public pure returns (string memory) {
return "😃, 😭, and 😈";
return unicode"😃, 😭, and 😈";
}
}
// ----
// ParserError 8936: (86-88): Invalid character in string.
@@ -0,0 +1,7 @@
contract test {
function f() public pure returns (string memory) {
return "😃, 😭, and 😈";
}
}
// ----
// ParserError 8936: (86-88): Invalid character in string.
@@ -19,3 +19,4 @@ contract test {
return res;
}
}
// ----