aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/unterminatedBlocks
diff options
context:
space:
mode:
authorherrBez <bez.mirko@gmail.com>2018-09-15 19:03:47 +0800
committerherrBez <bez.mirko@gmail.com>2018-09-21 05:02:44 +0800
commitfaa0caae084363f6809341ddb63f75d6c682b175 (patch)
tree179821780a96e1fa4393627ea8a706b0ff4c69ca /test/libsolidity/syntaxTests/unterminatedBlocks
parent2409986cf305c25d6a3d46c122521c7769dc7cd7 (diff)
downloaddexon-solidity-faa0caae084363f6809341ddb63f75d6c682b175.tar
dexon-solidity-faa0caae084363f6809341ddb63f75d6c682b175.tar.gz
dexon-solidity-faa0caae084363f6809341ddb63f75d6c682b175.tar.bz2
dexon-solidity-faa0caae084363f6809341ddb63f75d6c682b175.tar.lz
dexon-solidity-faa0caae084363f6809341ddb63f75d6c682b175.tar.xz
dexon-solidity-faa0caae084363f6809341ddb63f75d6c682b175.tar.zst
dexon-solidity-faa0caae084363f6809341ddb63f75d6c682b175.zip
Add syntax tests to augment the test coverage of
libsolidity/parsing/Scanner.cpp and libsolidity/parsing/Scanner.h Fix #4627 and PR #5003. - Add multiline comment test - Add upper case hex literal test - Add test for unicode escapes - Add test for strings with escaped newlines - Add test for string escapes - Add test for strings that do not terminate before end of file - Add test for unterminated blocks
Diffstat (limited to 'test/libsolidity/syntaxTests/unterminatedBlocks')
-rw-r--r--test/libsolidity/syntaxTests/unterminatedBlocks/one_dot.sol4
-rw-r--r--test/libsolidity/syntaxTests/unterminatedBlocks/one_dot_x.sol5
-rw-r--r--test/libsolidity/syntaxTests/unterminatedBlocks/zero_dot.sol4
-rw-r--r--test/libsolidity/syntaxTests/unterminatedBlocks/zero_dot_x.sol5
4 files changed, 18 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/unterminatedBlocks/one_dot.sol b/test/libsolidity/syntaxTests/unterminatedBlocks/one_dot.sol
new file mode 100644
index 00000000..a678f004
--- /dev/null
+++ b/test/libsolidity/syntaxTests/unterminatedBlocks/one_dot.sol
@@ -0,0 +1,4 @@
+contract c {
+ function f() pure public { 1.
+// ----
+// ParserError: (47-47): Expected identifier but got end of source \ No newline at end of file
diff --git a/test/libsolidity/syntaxTests/unterminatedBlocks/one_dot_x.sol b/test/libsolidity/syntaxTests/unterminatedBlocks/one_dot_x.sol
new file mode 100644
index 00000000..3cc59374
--- /dev/null
+++ b/test/libsolidity/syntaxTests/unterminatedBlocks/one_dot_x.sol
@@ -0,0 +1,5 @@
+contract test {
+ function f() pure public { 1.x; }
+}
+// ----
+// TypeError: (47-50): Member "x" not found or not visible after argument-dependent lookup in int_const 1. \ No newline at end of file
diff --git a/test/libsolidity/syntaxTests/unterminatedBlocks/zero_dot.sol b/test/libsolidity/syntaxTests/unterminatedBlocks/zero_dot.sol
new file mode 100644
index 00000000..6ba2b4c2
--- /dev/null
+++ b/test/libsolidity/syntaxTests/unterminatedBlocks/zero_dot.sol
@@ -0,0 +1,4 @@
+contract c {
+ function f() pure public { 0.
+// ----
+// ParserError: (47-47): Expected identifier but got end of source \ No newline at end of file
diff --git a/test/libsolidity/syntaxTests/unterminatedBlocks/zero_dot_x.sol b/test/libsolidity/syntaxTests/unterminatedBlocks/zero_dot_x.sol
new file mode 100644
index 00000000..8648bce2
--- /dev/null
+++ b/test/libsolidity/syntaxTests/unterminatedBlocks/zero_dot_x.sol
@@ -0,0 +1,5 @@
+contract test {
+ function f() pure public { 0.x; }
+}
+// ----
+// TypeError: (47-50): Member "x" not found or not visible after argument-dependent lookup in int_const 0. \ No newline at end of file