aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorhydai <z54981220@gmail.com>2018-09-19 01:09:16 +0800
committerhydai <z54981220@gmail.com>2018-09-19 22:01:15 +0800
commitb409faa675be96dda961b14eca9adde62be63263 (patch)
tree2c1bbc2c6af98066e71356cb0d09d8978cff67ba /test/libsolidity
parent5f919d02abc21e17d533a18876eabdf1a91939f7 (diff)
downloaddexon-solidity-b409faa675be96dda961b14eca9adde62be63263.tar.gz
dexon-solidity-b409faa675be96dda961b14eca9adde62be63263.tar.zst
dexon-solidity-b409faa675be96dda961b14eca9adde62be63263.zip
Disallow uppercase X in hex number literals
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityScanner.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityScanner.cpp b/test/libsolidity/SolidityScanner.cpp
index 3a210f94..93db236b 100644
--- a/test/libsolidity/SolidityScanner.cpp
+++ b/test/libsolidity/SolidityScanner.cpp
@@ -105,6 +105,11 @@ BOOST_AUTO_TEST_CASE(hex_numbers)
BOOST_CHECK_EQUAL(scanner.currentLiteral(), "0x765432536763762734623472346");
BOOST_CHECK_EQUAL(scanner.next(), Token::Semicolon);
BOOST_CHECK_EQUAL(scanner.next(), Token::EOS);
+ scanner.reset(CharStream("0x1234"), "");
+ BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number);
+ BOOST_CHECK_EQUAL(scanner.currentLiteral(), "0x1234");
+ scanner.reset(CharStream("0X1234"), "");
+ BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Illegal);
}
BOOST_AUTO_TEST_CASE(octal_numbers)