aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-07-25 03:22:46 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-07-25 18:01:41 +0800
commit7b5e9128747ff6f8775cdd2aa2029039f9850c2b (patch)
tree4093a38b4d5bf7662e5db138fc4b34a41179efcc /test
parent49573bad46f7c108bd3a00ec785f7da6a0066530 (diff)
downloaddexon-solidity-7b5e9128747ff6f8775cdd2aa2029039f9850c2b.tar.gz
dexon-solidity-7b5e9128747ff6f8775cdd2aa2029039f9850c2b.tar.zst
dexon-solidity-7b5e9128747ff6f8775cdd2aa2029039f9850c2b.zip
Add syntax tests for import statements
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/syntaxTests/parsing/import_complex.sol3
-rw-r--r--test/libsolidity/syntaxTests/parsing/import_complex_invalid_from.sol3
-rw-r--r--test/libsolidity/syntaxTests/parsing/import_complex_without_from.sol3
-rw-r--r--test/libsolidity/syntaxTests/parsing/import_invalid_token.sol3
-rw-r--r--test/libsolidity/syntaxTests/parsing/import_simple.sol3
5 files changed, 15 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/parsing/import_complex.sol b/test/libsolidity/syntaxTests/parsing/import_complex.sol
new file mode 100644
index 00000000..8bbb0a88
--- /dev/null
+++ b/test/libsolidity/syntaxTests/parsing/import_complex.sol
@@ -0,0 +1,3 @@
+import {hello, world} from "hello";
+// ----
+// ParserError: (0-35): Source "hello" not found: File not supplied initially.
diff --git a/test/libsolidity/syntaxTests/parsing/import_complex_invalid_from.sol b/test/libsolidity/syntaxTests/parsing/import_complex_invalid_from.sol
new file mode 100644
index 00000000..c4667606
--- /dev/null
+++ b/test/libsolidity/syntaxTests/parsing/import_complex_invalid_from.sol
@@ -0,0 +1,3 @@
+import {hello, world} from function;
+// ----
+// ParserError: (27-35): Expected import path.
diff --git a/test/libsolidity/syntaxTests/parsing/import_complex_without_from.sol b/test/libsolidity/syntaxTests/parsing/import_complex_without_from.sol
new file mode 100644
index 00000000..961acb22
--- /dev/null
+++ b/test/libsolidity/syntaxTests/parsing/import_complex_without_from.sol
@@ -0,0 +1,3 @@
+import {hello, world};
+// ----
+// ParserError: (21-22): Expected "from".
diff --git a/test/libsolidity/syntaxTests/parsing/import_invalid_token.sol b/test/libsolidity/syntaxTests/parsing/import_invalid_token.sol
new file mode 100644
index 00000000..df837e28
--- /dev/null
+++ b/test/libsolidity/syntaxTests/parsing/import_invalid_token.sol
@@ -0,0 +1,3 @@
+import function;
+// ----
+// ParserError: (7-15): Expected string literal (path), "*" or alias list.
diff --git a/test/libsolidity/syntaxTests/parsing/import_simple.sol b/test/libsolidity/syntaxTests/parsing/import_simple.sol
new file mode 100644
index 00000000..5d61a8bb
--- /dev/null
+++ b/test/libsolidity/syntaxTests/parsing/import_simple.sol
@@ -0,0 +1,3 @@
+import "hello";
+// ----
+// ParserError: (0-15): Source "hello" not found: File not supplied initially.