aboutsummaryrefslogtreecommitdiffstats
path: root/solidityScanner.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2014-12-18 23:48:25 +0800
committerLefteris Karapetsas <lefteris@refu.co>2014-12-18 23:48:25 +0800
commitfc981d5d799c28207d464e273524650c8a166243 (patch)
tree311129391baf6c751fe8064fe9d13e35c9ed8fbe /solidityScanner.cpp
parentd6a696830fbda5709e65fda0d6cae8bf2c911594 (diff)
downloaddexon-solidity-fc981d5d799c28207d464e273524650c8a166243.tar
dexon-solidity-fc981d5d799c28207d464e273524650c8a166243.tar.gz
dexon-solidity-fc981d5d799c28207d464e273524650c8a166243.tar.bz2
dexon-solidity-fc981d5d799c28207d464e273524650c8a166243.tar.lz
dexon-solidity-fc981d5d799c28207d464e273524650c8a166243.tar.xz
dexon-solidity-fc981d5d799c28207d464e273524650c8a166243.tar.zst
dexon-solidity-fc981d5d799c28207d464e273524650c8a166243.zip
More multiline natspec tests and small issue fix
Diffstat (limited to 'solidityScanner.cpp')
-rw-r--r--solidityScanner.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/solidityScanner.cpp b/solidityScanner.cpp
index 159e5305..355ea9e2 100644
--- a/solidityScanner.cpp
+++ b/solidityScanner.cpp
@@ -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_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)
{
Scanner scanner(CharStream("//"));