add LemonBoy's test

This commit is contained in:
Vexu
2020-03-09 18:38:54 +02:00
parent 03c1431f9c
commit 3fd2cd4367
3 changed files with 25 additions and 3 deletions

View File

@@ -4,11 +4,17 @@ const std = @import("std");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.addTest("combination of noasync and async",
\\export fn entry() void {
\\ noasync async foo();
\\ noasync {
\\ const bar = async foo();
\\ suspend;
\\ resume bar;
\\ }
\\}
\\fn foo() void {}
, &[_][]const u8{
"tmp.zig:2:13: error: async call in noasync scope",
"tmp.zig:3:21: error: async call in noasync scope",
"tmp.zig:4:9: error: suspend in noasync scope",
"tmp.zig:5:9: error: resume in noasync scope",
});
cases.addTest("@TypeOf with no arguments",