fix missing compile error on while/for missing block

This commit is contained in:
Vexu
2020-05-20 11:34:31 +03:00
parent 69ff89fd12
commit e07b467c7c
3 changed files with 52 additions and 43 deletions

View File

@@ -210,6 +210,19 @@ test "recovery: invalid comptime" {
});
}
test "recovery: missing block after for/while loops" {
try testError(
\\test "" { while (foo) }
, &[_]Error{
.ExpectedBlockOrAssignment,
});
try testError(
\\test "" { for (foo) |bar| }
, &[_]Error{
.ExpectedBlockOrAssignment,
});
}
test "zig fmt: if statment" {
try testCanonical(
\\test "" {