aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityScanner.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-07-24 09:15:36 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-07-25 19:59:28 +0800
commitb079f34c6545cfb3f4673336bbc3c2ea61c2148d (patch)
tree9fd858ccc44409a46cc3f34bab9ce31c99b6c935 /test/libsolidity/SolidityScanner.cpp
parentaee13d709c7083d2b3e1b567f05f1e1624073dbc (diff)
downloaddexon-solidity-b079f34c6545cfb3f4673336bbc3c2ea61c2148d.tar.gz
dexon-solidity-b079f34c6545cfb3f4673336bbc3c2ea61c2148d.tar.zst
dexon-solidity-b079f34c6545cfb3f4673336bbc3c2ea61c2148d.zip
Scanner tests for all shifts
Diffstat (limited to 'test/libsolidity/SolidityScanner.cpp')
-rw-r--r--test/libsolidity/SolidityScanner.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityScanner.cpp b/test/libsolidity/SolidityScanner.cpp
index 6cc3032f..42e1b18e 100644
--- a/test/libsolidity/SolidityScanner.cpp
+++ b/test/libsolidity/SolidityScanner.cpp
@@ -207,7 +207,7 @@ BOOST_AUTO_TEST_CASE(locations)
BOOST_AUTO_TEST_CASE(ambiguities)
{
// test scanning of some operators which need look-ahead
- Scanner scanner(CharStream("<=""<""+ +=a++ =>""<<"));
+ Scanner scanner(CharStream("<=" "<" "+ +=a++ =>" "<<" ">>" " >>=" ">>>" ">>>=" " >>>>>=><<="));
BOOST_CHECK_EQUAL(scanner.currentToken(), Token::LessThanOrEqual);
BOOST_CHECK_EQUAL(scanner.next(), Token::LessThan);
BOOST_CHECK_EQUAL(scanner.next(), Token::Add);
@@ -216,6 +216,15 @@ BOOST_AUTO_TEST_CASE(ambiguities)
BOOST_CHECK_EQUAL(scanner.next(), Token::Inc);
BOOST_CHECK_EQUAL(scanner.next(), Token::Arrow);
BOOST_CHECK_EQUAL(scanner.next(), Token::SHL);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SAR);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::AssignSar);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SHR);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::AssignShr);
+ // the last "monster" token combination
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SHR);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::AssignSar);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::GreaterThan);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::AssignShl);
}
BOOST_AUTO_TEST_CASE(documentation_comments_parsed_begin)