aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-07-24 09:13:38 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-07-25 19:59:24 +0800
commitaee13d709c7083d2b3e1b567f05f1e1624073dbc (patch)
tree6893d8b5a1b1a0dca6d6bb39e08f97c887fc4dbc
parentae15b52d932dc7b186b6560e8d910106c5ca1043 (diff)
downloaddexon-solidity-aee13d709c7083d2b3e1b567f05f1e1624073dbc.tar
dexon-solidity-aee13d709c7083d2b3e1b567f05f1e1624073dbc.tar.gz
dexon-solidity-aee13d709c7083d2b3e1b567f05f1e1624073dbc.tar.bz2
dexon-solidity-aee13d709c7083d2b3e1b567f05f1e1624073dbc.tar.lz
dexon-solidity-aee13d709c7083d2b3e1b567f05f1e1624073dbc.tar.xz
dexon-solidity-aee13d709c7083d2b3e1b567f05f1e1624073dbc.tar.zst
dexon-solidity-aee13d709c7083d2b3e1b567f05f1e1624073dbc.zip
Scanner tests for all escapes
-rw-r--r--test/libsolidity/SolidityScanner.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityScanner.cpp b/test/libsolidity/SolidityScanner.cpp
index f455c5eb..6cc3032f 100644
--- a/test/libsolidity/SolidityScanner.cpp
+++ b/test/libsolidity/SolidityScanner.cpp
@@ -64,6 +64,14 @@ BOOST_AUTO_TEST_CASE(string_escapes)
BOOST_CHECK_EQUAL(scanner.currentLiteral(), "aa");
}
+BOOST_AUTO_TEST_CASE(string_escapes_all)
+{
+ Scanner scanner(CharStream(" { \"a\\x61\\b\\f\\n\\r\\t\\v\""));
+ BOOST_CHECK_EQUAL(scanner.currentToken(), Token::LBrace);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::StringLiteral);
+ BOOST_CHECK_EQUAL(scanner.currentLiteral(), "aa\b\f\n\r\t\v");
+}
+
BOOST_AUTO_TEST_CASE(string_escapes_with_zero)
{
Scanner scanner(CharStream(" { \"a\\x61\\x00abc\""));