From c3a2cd8c1eadf73b4937434392453ccfde3aa5cc Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Tue, 4 Dec 2018 21:43:43 +0900 Subject: [PATCH] use hexcode instead of u8 string on windows --- tests/test_lex_key_comment.cpp | 5 +++++ tests/test_lex_string.cpp | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/tests/test_lex_key_comment.cpp b/tests/test_lex_key_comment.cpp index 291fbf1..2598c64 100644 --- a/tests/test_lex_key_comment.cpp +++ b/tests/test_lex_key_comment.cpp @@ -18,7 +18,12 @@ BOOST_AUTO_TEST_CASE(test_quoted_key) { TOML11_TEST_LEX_ACCEPT(lex_key, "\"127.0.0.1\"", "\"127.0.0.1\""); TOML11_TEST_LEX_ACCEPT(lex_key, "\"character encoding\"", "\"character encoding\""); +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) + TOML11_TEST_LEX_ACCEPT(lex_key, "\"\xCA\x8E\xC7\x9D\xCA\x9E\"", + "\"\xCA\x8E\xC7\x9D\xCA\x9E\""); +#else TOML11_TEST_LEX_ACCEPT(lex_key, u8"\"ʎǝʞ\"", u8"\"ʎǝʞ\""); +#endif TOML11_TEST_LEX_ACCEPT(lex_key, "'key2'", "'key2'"); TOML11_TEST_LEX_ACCEPT(lex_key, "'quoted \"value\"'", "'quoted \"value\"'"); } diff --git a/tests/test_lex_string.cpp b/tests/test_lex_string.cpp index a02d5de..fcf0727 100644 --- a/tests/test_lex_string.cpp +++ b/tests/test_lex_string.cpp @@ -30,9 +30,17 @@ BOOST_AUTO_TEST_CASE(test_basic_string) TOML11_TEST_LEX_ACCEPT(lex_string, "\"192.168.1.1\"", "\"192.168.1.1\""); + +#if defined(_MSC_VER) || defined(__INTEL_COMPILER) + TOML11_TEST_LEX_ACCEPT(lex_string, + "\"\xE4\xB8\xAD\xE5\x9B\xBD\"", + "\"\xE4\xB8\xAD\xE5\x9B\xBD\""); +#else TOML11_TEST_LEX_ACCEPT(lex_string, u8"\"中国\"", u8"\"中国\""); +#endif + TOML11_TEST_LEX_ACCEPT(lex_string, "\"You'll hate me after this - #\"", "\"You'll hate me after this - #\"");