mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
More multiline natspec tests and small issue fix
This commit is contained in:
parent
d6a696830f
commit
fc981d5d79
@ -189,6 +189,30 @@ BOOST_AUTO_TEST_CASE(multiline_documentation_comments_parsed)
|
|||||||
BOOST_CHECK_EQUAL(scanner.getCurrentCommentLiteral(), "Send $(value / 1000) chocolates to the user");
|
BOOST_CHECK_EQUAL(scanner.getCurrentCommentLiteral(), "Send $(value / 1000) chocolates to the user");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(multiline_documentation_no_stars)
|
||||||
|
{
|
||||||
|
Scanner scanner(CharStream("some other tokens /**\n"
|
||||||
|
" Send $(value / 1000) chocolates to the user\n"
|
||||||
|
"*/"));
|
||||||
|
BOOST_CHECK_EQUAL(scanner.getCurrentToken(), Token::IDENTIFIER);
|
||||||
|
BOOST_CHECK_EQUAL(scanner.next(), Token::IDENTIFIER);
|
||||||
|
BOOST_CHECK_EQUAL(scanner.next(), Token::IDENTIFIER);
|
||||||
|
BOOST_CHECK_EQUAL(scanner.next(), Token::EOS);
|
||||||
|
BOOST_CHECK_EQUAL(scanner.getCurrentCommentLiteral(), "Send $(value / 1000) chocolates to the user");
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(multiline_documentation_whitespace_hell)
|
||||||
|
{
|
||||||
|
Scanner scanner(CharStream("some other tokens /** \t \r \n"
|
||||||
|
"\t \r * Send $(value / 1000) chocolates to the user\n"
|
||||||
|
"*/"));
|
||||||
|
BOOST_CHECK_EQUAL(scanner.getCurrentToken(), Token::IDENTIFIER);
|
||||||
|
BOOST_CHECK_EQUAL(scanner.next(), Token::IDENTIFIER);
|
||||||
|
BOOST_CHECK_EQUAL(scanner.next(), Token::IDENTIFIER);
|
||||||
|
BOOST_CHECK_EQUAL(scanner.next(), Token::EOS);
|
||||||
|
BOOST_CHECK_EQUAL(scanner.getCurrentCommentLiteral(), "Send $(value / 1000) chocolates to the user");
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(comment_before_eos)
|
BOOST_AUTO_TEST_CASE(comment_before_eos)
|
||||||
{
|
{
|
||||||
Scanner scanner(CharStream("//"));
|
Scanner scanner(CharStream("//"));
|
||||||
|
Loading…
Reference in New Issue
Block a user