commit 39d1afc010b4eeb485cae03b982bd8d7612cc39f
parent f6fa21c58284f9a34d7f2a9ec5519537dffa0be4
Author: Sebastian <sebastian@sebsite.pw>
Date: Fri, 29 Sep 2023 22:19:58 -0400
hare::parse+test: test switch/match as unary operand
Signed-off-by: Sebastian <sebastian@sebsite.pw>
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/hare/parse/+test/expr_test.ha b/hare/parse/+test/expr_test.ha
@@ -302,7 +302,13 @@
"export fn main() void = *void;\n\n"
"export fn main() void = ~void;\n\n"
"export fn main() void = !void;\n\n"
- "export fn main() void = &void;\n");
+ "export fn main() void = &void;\n\n"
+ "export fn main() void = &switch (0) {\n"
+ "case => void;\n"
+ "};\n\n"
+ "export fn main() void = &match (0) {\n"
+ "case => void;\n"
+ "};\n");
};
@test fn yield_expr() void = {