aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityScanner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SolidityScanner.cpp')
-rw-r--r--SolidityScanner.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/SolidityScanner.cpp b/SolidityScanner.cpp
index b7942d29..7dc9ef48 100644
--- a/SolidityScanner.cpp
+++ b/SolidityScanner.cpp
@@ -103,14 +103,17 @@ BOOST_AUTO_TEST_CASE(negative_numbers)
BOOST_CHECK_EQUAL(scanner.getCurrentToken(), Token::VAR);
BOOST_CHECK_EQUAL(scanner.next(), Token::IDENTIFIER);
BOOST_CHECK_EQUAL(scanner.next(), Token::ASSIGN);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SUB);
BOOST_CHECK_EQUAL(scanner.next(), Token::NUMBER);
- BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), "-.2");
+ BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), ".2");
BOOST_CHECK_EQUAL(scanner.next(), Token::ADD);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SUB);
BOOST_CHECK_EQUAL(scanner.next(), Token::NUMBER);
- BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), "-0x78");
+ BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), "0x78");
BOOST_CHECK_EQUAL(scanner.next(), Token::ADD);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SUB);
BOOST_CHECK_EQUAL(scanner.next(), Token::NUMBER);
- BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), "-7.3");
+ BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), "7.3");
BOOST_CHECK_EQUAL(scanner.next(), Token::ADD);
BOOST_CHECK_EQUAL(scanner.next(), Token::NUMBER);
BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), "8.9");
@@ -130,8 +133,9 @@ BOOST_AUTO_TEST_CASE(locations)
BOOST_CHECK_EQUAL(scanner.next(), Token::SEMICOLON);
BOOST_CHECK_EQUAL(scanner.getCurrentLocation().start, 24);
BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end, 25);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SUB);
BOOST_CHECK_EQUAL(scanner.next(), Token::NUMBER);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().start, 26);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().start, 27);
BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end, 32);
BOOST_CHECK_EQUAL(scanner.next(), Token::IDENTIFIER);
BOOST_CHECK_EQUAL(scanner.getCurrentLocation().start, 45);