From 5e8a1e0ae6dcd269258fe4239060bcc890abacb5 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 15 Feb 2017 15:21:11 +0100 Subject: Test for unicode string literals. --- test/libsolidity/InlineAssembly.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp index 437c5866..8744d96f 100644 --- a/test/libsolidity/InlineAssembly.cpp +++ b/test/libsolidity/InlineAssembly.cpp @@ -198,6 +198,17 @@ BOOST_AUTO_TEST_CASE(print_string_literals) parsePrintCompare("{\n \"\\n'\\xab\\x95\\\"\"\n}"); } +BOOST_AUTO_TEST_CASE(print_string_literal_unicode) +{ + string source = "{ \"\\u1bac\" }"; + string parsed = "{\n \"\\xe1\\xae\\xac\"\n}"; + assembly::InlineAssemblyStack stack; + BOOST_REQUIRE(stack.parse(std::make_shared(CharStream(source)))); + BOOST_REQUIRE(stack.errors().empty()); + BOOST_CHECK_EQUAL(stack.toString(), parsed); + parsePrintCompare(parsed); +} + BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE(Analysis) -- cgit