diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-01-22 20:40:14 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-01-22 22:00:29 +0200 |
commit | a387c9b95d293eccca657bee39b6b1d16703650b (patch) | |
tree | 2f414f0ff39d77ffcaa8f23bd2dc61b33ae46034 /src | |
parent | 0a426f359205c1a25f400b2079e374be40724d6a (diff) | |
download | minetest-a387c9b95d293eccca657bee39b6b1d16703650b.tar.gz minetest-a387c9b95d293eccca657bee39b6b1d16703650b.tar.bz2 minetest-a387c9b95d293eccca657bee39b6b1d16703650b.zip |
Fix "illegal escape sequence" in MSVC (actually not illegal)
Diffstat (limited to 'src')
-rw-r--r-- | src/test.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test.cpp b/src/test.cpp index 2d5c86e64..23113b123 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -215,6 +215,8 @@ struct TestSerialization mkstr("\1\0") + teststring2_w_encoded); assert(serializeLongString(teststring2) == mkstr("\0\0\1\0") + teststring2); + // MSVC fails when directly using "\\\\" + std::string backslash = "\\"; assert(serializeJsonString(teststring2) == mkstr("\"") + "\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007" + @@ -223,7 +225,7 @@ struct TestSerialization "\\u0018\\u0019\\u001a\\u001b\\u001c\\u001d\\u001e\\u001f" + " !\\\"" + teststring2.substr(0x23, 0x2f-0x23) + "\\/" + teststring2.substr(0x30, 0x5c-0x30) + - "\\\\" + teststring2.substr(0x5d, 0x7f-0x5d) + "\\u007f" + + backslash + backslash + teststring2.substr(0x5d, 0x7f-0x5d) + "\\u007f" + "\\u0080\\u0081\\u0082\\u0083\\u0084\\u0085\\u0086\\u0087" + "\\u0088\\u0089\\u008a\\u008b\\u008c\\u008d\\u008e\\u008f" + "\\u0090\\u0091\\u0092\\u0093\\u0094\\u0095\\u0096\\u0097" + |