aboutsummaryrefslogtreecommitdiffstats
path: root/solidityScanner.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2014-11-21 06:18:05 +0800
committerLefteris Karapetsas <lefteris@refu.co>2014-11-21 06:18:05 +0800
commit70a5c84095ae7051b1ab92ed42b2d947ce4fe9a3 (patch)
tree7c616a490e219da7d340d4dac0138b7e523ccde3 /solidityScanner.cpp
parent6275b1ee93e5f4174a0ddd6da525dd9ca74edc09 (diff)
downloaddexon-solidity-70a5c84095ae7051b1ab92ed42b2d947ce4fe9a3.tar.gz
dexon-solidity-70a5c84095ae7051b1ab92ed42b2d947ce4fe9a3.tar.zst
dexon-solidity-70a5c84095ae7051b1ab92ed42b2d947ce4fe9a3.zip
extra comments scanning test
Diffstat (limited to 'solidityScanner.cpp')
-rw-r--r--solidityScanner.cpp11
1 files changed, 11 insertions, 0 deletions
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()
}