From 7b5e9128747ff6f8775cdd2aa2029039f9850c2b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 24 Jul 2018 20:22:46 +0100 Subject: Add syntax tests for import statements --- test/libsolidity/syntaxTests/parsing/import_complex.sol | 3 +++ test/libsolidity/syntaxTests/parsing/import_complex_invalid_from.sol | 3 +++ test/libsolidity/syntaxTests/parsing/import_complex_without_from.sol | 3 +++ test/libsolidity/syntaxTests/parsing/import_invalid_token.sol | 3 +++ test/libsolidity/syntaxTests/parsing/import_simple.sol | 3 +++ 5 files changed, 15 insertions(+) create mode 100644 test/libsolidity/syntaxTests/parsing/import_complex.sol create mode 100644 test/libsolidity/syntaxTests/parsing/import_complex_invalid_from.sol create mode 100644 test/libsolidity/syntaxTests/parsing/import_complex_without_from.sol create mode 100644 test/libsolidity/syntaxTests/parsing/import_invalid_token.sol create mode 100644 test/libsolidity/syntaxTests/parsing/import_simple.sol (limited to 'test/libsolidity/syntaxTests') 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. -- cgit