mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
extra comments scanning test
This commit is contained in:
parent
6275b1ee93
commit
70a5c84095
@ -174,6 +174,7 @@ BOOST_AUTO_TEST_CASE(comment_before_eos)
|
|||||||
{
|
{
|
||||||
Scanner scanner(CharStream("//"));
|
Scanner scanner(CharStream("//"));
|
||||||
BOOST_CHECK_EQUAL(scanner.getCurrentToken(), Token::EOS);
|
BOOST_CHECK_EQUAL(scanner.getCurrentToken(), Token::EOS);
|
||||||
|
BOOST_CHECK_EQUAL(scanner.getCurrentCommentLiteral(), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(documentation_comment_before_eos)
|
BOOST_AUTO_TEST_CASE(documentation_comment_before_eos)
|
||||||
@ -183,6 +184,16 @@ BOOST_AUTO_TEST_CASE(documentation_comment_before_eos)
|
|||||||
BOOST_CHECK_EQUAL(scanner.getCurrentCommentLiteral(), "");
|
BOOST_CHECK_EQUAL(scanner.getCurrentCommentLiteral(), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(comments_mixed_in_sequence)
|
||||||
|
{
|
||||||
|
Scanner scanner(CharStream("hello_world ///documentation comment \n"
|
||||||
|
"//simple comment \n"
|
||||||
|
"<<"));
|
||||||
|
BOOST_CHECK_EQUAL(scanner.getCurrentToken(), Token::IDENTIFIER);
|
||||||
|
BOOST_CHECK_EQUAL(scanner.next(), Token::SHL);
|
||||||
|
BOOST_CHECK_EQUAL(scanner.getCurrentCommentLiteral(), "documentation comment ");
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user