Commit 0414faac authored by Harris Hancock's avatar Harris Hancock

Move MSVC-unfriendly literal outside of macro

parent 9c33f4f4
......@@ -577,7 +577,12 @@ KJ_TEST("basic json decoding") {
KJ_EXPECT_THROW_MESSAGE("Input remains", json.decodeRaw("11a", root));
KJ_EXPECT_THROW_MESSAGE("Invalid escape", json.decodeRaw(R"("\z")", root));
KJ_EXPECT_THROW_MESSAGE("Invalid escape", json.decodeRaw(R"("\z")", root));
KJ_EXPECT_THROW_MESSAGE("ends prematurely", json.decodeRaw(R"(["\n\", 3])", root));
{
// TODO(msvc): This raw string literal currently confuses MSVC's preprocessor, so I hoisted
// it outside the macro.
auto f = [&] { json.decodeRaw(R"(["\n\", 3])", root); };
KJ_EXPECT_THROW_MESSAGE("ends prematurely", f());
}
KJ_EXPECT_THROW_MESSAGE("Invalid hex", json.decodeRaw(R"("\u12zz")", root));
KJ_EXPECT_THROW_MESSAGE("ends prematurely", json.decodeRaw("-", root));
KJ_EXPECT_THROW_MESSAGE("Unexpected input", json.decodeRaw("--", root));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment