diff options
author | hydai <z54981220@gmail.com> | 2018-09-19 01:09:16 +0800 |
---|---|---|
committer | hydai <z54981220@gmail.com> | 2018-09-19 22:01:15 +0800 |
commit | b409faa675be96dda961b14eca9adde62be63263 (patch) | |
tree | 2c1bbc2c6af98066e71356cb0d09d8978cff67ba /test/libsolidity/SolidityScanner.cpp | |
parent | 5f919d02abc21e17d533a18876eabdf1a91939f7 (diff) | |
download | dexon-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/SolidityScanner.cpp')
-rw-r--r-- | test/libsolidity/SolidityScanner.cpp | 5 |
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) |