From 70a5c84095ae7051b1ab92ed42b2d947ce4fe9a3 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 20 Nov 2014 23:18:05 +0100 Subject: extra comments scanning test --- solidityScanner.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'solidityScanner.cpp') diff --git a/solidityScanner.cpp b/solidityScanner.cpp index 1a2299f3..573affe6 100644 --- a/solidityScanner.cpp +++ b/solidityScanner.cpp @@ -174,6 +174,7 @@ BOOST_AUTO_TEST_CASE(comment_before_eos) { Scanner scanner(CharStream("//")); BOOST_CHECK_EQUAL(scanner.getCurrentToken(), Token::EOS); + BOOST_CHECK_EQUAL(scanner.getCurrentCommentLiteral(), ""); } 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_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() } -- cgit