diff options
author | chriseth <c@ethdev.com> | 2015-12-15 01:01:40 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-12-18 19:46:54 +0800 |
commit | d3c459b5a99715c96733825f78d63cc57265ee3c (patch) | |
tree | f1add9102a402a3942caec4e0f296a69493759e7 /test/libsolidity | |
parent | fe23cc82263c75f34e05795e12fedb08bc14e6a4 (diff) | |
download | dexon-solidity-d3c459b5a99715c96733825f78d63cc57265ee3c.tar.gz dexon-solidity-d3c459b5a99715c96733825f78d63cc57265ee3c.tar.zst dexon-solidity-d3c459b5a99715c96733825f78d63cc57265ee3c.zip |
Parse complex import directives.
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityParser.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index e6c8a8d8..5c5a9f68 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -1047,6 +1047,27 @@ BOOST_AUTO_TEST_CASE(using_for) BOOST_CHECK(successParse(text)); } +BOOST_AUTO_TEST_CASE(complex_import) +{ + char const* text = R"( + import "abc" as x; + import * as x from "abc"; + import {a as b, c as d, f} from "def"; + contract x {} + )"; + BOOST_CHECK(successParse(text)); +} + +BOOST_AUTO_TEST_CASE(from_is_not_keyword) +{ + // "from" is not a keyword although it is used as a keyword in import directives. + char const* text = R"( + contract from { + } + )"; + BOOST_CHECK(successParse(text)); +} + BOOST_AUTO_TEST_CASE(inline_array_declaration) { char const* text = R"( |