From c36b2f5ac08cea2ca6fc94681359baa2b3d1ce93 Mon Sep 17 00:00:00 2001 From: Jonathan Tatum Date: Fri, 8 May 2026 09:28:38 -0700 Subject: [PATCH] Add parser tests for escaped characters in triple-quoted strings. PiperOrigin-RevId: 912562715 --- parser/parser_test.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/parser/parser_test.cc b/parser/parser_test.cc index 587b63a30..0ade80d0e 100644 --- a/parser/parser_test.cc +++ b/parser/parser_test.cc @@ -368,6 +368,11 @@ std::vector test_cases = { {"(a)", "a^#1:Expr.Ident#"}, {"((a))", "a^#1:Expr.Ident#"}, {"a()", "a()^#1:Expr.Call#"}, + {R"("""\?""")", R"("?"^#1:string#)"}, + {R"('''\?''')", R"("?"^#1:string#)"}, + // ExprPrinter passes through cescape so BACKSLASH is escaped. + {R"("""\\?""")", R"("\\?"^#1:string#)"}, + {R"('''\\\?''')", R"("\\?"^#1:string#)"}, {"a(b)", "a(\n" " b^#2:Expr.Ident#\n"