mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Scanner tests for all shifts
This commit is contained in:
parent
aee13d709c
commit
b079f34c65
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user