@@ -1176,24 +1176,10 @@ TEST(SwitchCase, MatchesSwitch) {
11761176}
11771177
11781178TEST (PatternMatching, MatchesInspect) {
1179- EXPECT_TRUE (matchesConditionally (" void x() { inspect(42) { __:; } }" , inspectExpr (), true , " -fpattern-matching" ));
1180- EXPECT_TRUE (matchesConditionally (" void x() { inspect(42) { 42:; } }" , inspectExpr (), true , " -fpattern-matching" ));
1181- EXPECT_TRUE (matchesConditionally (" void x() { int y=0; inspect(42) { y:; } }" , inspectExpr (), true , " -fpattern-matching" ));
1179+ EXPECT_TRUE (matchesConditionally (" void x() { inspect(42) { __ => {} }; }" , inspectExpr (), true , " -fpattern-matching" ));
1180+ EXPECT_TRUE (matchesConditionally (" void x() { inspect(42) { 42 => {} }; }" , inspectExpr (), true , " -fpattern-matching" ));
1181+ EXPECT_TRUE (matchesConditionally (" void x() { int y=0; inspect(42) { y => {} }; }" , inspectExpr (), true , " -fpattern-matching" ));
11821182 EXPECT_TRUE (matchesConditionally (" void x() { }" , inspectExpr (), false , " -fpattern-matching" ));
1183-
1184- EXPECT_TRUE (matchesConditionally (" void x() { struct A{int x;}; A a = {42}; inspect(a) { __:; } }" , inspectExpr (), true , " -fpattern-matching" ));
1185- EXPECT_TRUE (matchesConditionally (" void x() { struct A{int x; bool operator==(const A& other) { return x == other.x; } }; A a = {42}; A b = a; inspect(a) { b:; } }" , inspectExpr (), true , " -fpattern-matching" ));
1186- }
1187-
1188- TEST (PatternMatching, MatchesPattern) {
1189- EXPECT_TRUE (matchesConditionally (" void x() { inspect(42) { __:; } }" , patternStmt (), true , " -fpattern-matching" ));
1190- EXPECT_TRUE (matchesConditionally (" void x() { inspect(42) { 42:; } }" , patternStmt (), true , " -fpattern-matching" ));
1191- EXPECT_TRUE (matchesConditionally (" void x() { int y=0; inspect(42) { y:; } }" , patternStmt (), true , " -fpattern-matching" ));
1192- EXPECT_TRUE (matchesConditionally (" void x() { }" , patternStmt (), false , " -fpattern-matching" ));
1193-
1194-
1195- EXPECT_TRUE (matchesConditionally (" void x() { int a=42; inspect(42) { a if(true):; } }" , patternStmt (), true , " -fpattern-matching" ));
1196- EXPECT_TRUE (matchesConditionally (" void x() { inspect(42) { 42 if(true):; } }" , patternStmt (), true , " -fpattern-matching" ));
11971183}
11981184
11991185TEST (ExceptionHandling, SimpleCases) {
0 commit comments