aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-01-15 23:15:01 +0800
committerChristian <c@ethdev.com>2015-01-20 06:35:04 +0800
commitffed2f37cbd6ccde0f58df8e24e801e61c1ae353 (patch)
tree3582c1e6a22d7ae58168a0c26031cc63868c4fca
parent02521a164ce8fc49d6d4af584da127098c59ba2f (diff)
downloaddexon-solidity-ffed2f37cbd6ccde0f58df8e24e801e61c1ae353.tar.gz
dexon-solidity-ffed2f37cbd6ccde0f58df8e24e801e61c1ae353.tar.zst
dexon-solidity-ffed2f37cbd6ccde0f58df8e24e801e61c1ae353.zip
Inheritance parser.
-rw-r--r--SolidityParser.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/SolidityParser.cpp b/SolidityParser.cpp
index 86f935c3..f18c530b 100644
--- a/SolidityParser.cpp
+++ b/SolidityParser.cpp
@@ -495,6 +495,36 @@ BOOST_AUTO_TEST_CASE(multiple_contracts_and_imports)
BOOST_CHECK_NO_THROW(parseText(text));
}
+BOOST_AUTO_TEST_CASE(contract_inheritance)
+{
+ char const* text = "contract base {\n"
+ " function fun() {\n"
+ " uint64(2);\n"
+ " }\n"
+ "}\n"
+ "contract derived is base {\n"
+ " function fun() {\n"
+ " uint64(2);\n"
+ " }\n"
+ "}\n";
+ BOOST_CHECK_NO_THROW(parseText(text));
+}
+
+BOOST_AUTO_TEST_CASE(contract_multiple_inheritance)
+{
+ char const* text = "contract base {\n"
+ " function fun() {\n"
+ " uint64(2);\n"
+ " }\n"
+ "}\n"
+ "contract derived is base, nonExisting {\n"
+ " function fun() {\n"
+ " uint64(2);\n"
+ " }\n"
+ "}\n";
+ BOOST_CHECK_NO_THROW(parseText(text));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}