From eaab71294476f46513678be2e8cad02589d141dc Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Wed, 30 Nov 2016 17:28:07 +0100 Subject: parser: recognize an end of comment of the form `**/` at the end of a multi-line doc comment This fixes #1433 --- test/libsolidity/SolidityParser.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index a3217f08..1c616ef6 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -962,6 +962,19 @@ BOOST_AUTO_TEST_CASE(empty_comment) BOOST_CHECK(successParse(text)); } +BOOST_AUTO_TEST_CASE(comment_end_with_double_star) +{ + char const* text = R"( + contract C1 { + /** + **/ + } + contract C2 {} + )"; + BOOST_CHECK(successParse(text)); +} + + BOOST_AUTO_TEST_CASE(library_simple) { char const* text = R"( -- cgit From 610027cd26dda1cded357f62585e75eed3cb0e48 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 30 Nov 2016 23:54:02 +0000 Subject: Test that contracts separated by comments are compiled --- test/libsolidity/SolidityEndToEndTest.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 98ea92ca..f2678d5b 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -8378,6 +8378,18 @@ BOOST_AUTO_TEST_CASE(inline_assembly_invalidjumplabel) BOOST_CHECK(callContractFunction("f()") == encodeArgs()); } +BOOST_AUTO_TEST_CASE(contracts_separated_with_comment) +{ + char const* sourceCode = R"( + contract C1 {} + /** + **/ + contract C2 {} + )"; + compileAndRun(sourceCode, 0, "C1"); + compileAndRun(sourceCode, 0, "C2"); +} + BOOST_AUTO_TEST_SUITE_END() } -- cgit