{child} />"_sv, jsx_options);
+ Expression* ast = p.parse_expression();
+ ASSERT_EQ(summarize(ast), "jsxelement(div, jsxelement(span, var child))");
+ }
+
+ {
+ Test_Parser p(u8"
{child}> />"_sv, jsx_options);
+ Expression* ast = p.parse_expression();
+ ASSERT_EQ(summarize(ast), "jsxelement(div, jsxfragment(var child))");
+ }
+
{
Test_Parser p(u8"
"_sv, jsx_options);
Expression* ast = p.parse_expression();
@@ -401,6 +419,15 @@ TEST_F(Test_Parse_Expression_JSX,
EXPECT_EQ(summarize(ast), "jsxelement(const)");
}
}
+
+TEST_F(Test_Parse_Expression_JSX, greater_greater_token_is_split) {
+ {
+ Test_Parser p(u8"
> "_sv, jsx_options);
+ // ^^ Token should be split into two '>'s.
+ Expression* ast = p.parse_expression();
+ ASSERT_EQ(summarize(ast), "jsxelement(A, jsxelement(B))");
+ }
+}
}
}