diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-05-14 00:08:29 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-05-14 00:08:29 -0700 |
| commit | 9958652d92ee074fbd71a5d75a56341518cc0f99 (patch) | |
| tree | ab70c44975a435087674aab07bdb9f617c09337b | |
| parent | 8344a50e1c545bbeb63debc90cb91289be53b689 (diff) | |
| download | zig-9958652d92ee074fbd71a5d75a56341518cc0f99.tar.gz zig-9958652d92ee074fbd71a5d75a56341518cc0f99.zip | |
stage2: update test cases to improved source locations
| -rw-r--r-- | test/stage2/test.zig | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/test/stage2/test.zig b/test/stage2/test.zig index 46722175da..213b8d0ced 100644 --- a/test/stage2/test.zig +++ b/test/stage2/test.zig @@ -1201,7 +1201,7 @@ pub fn addCases(ctx: *TestContext) !void { \\} , &[_][]const u8{ ":3:1: error: redeclaration of 'entry'", - ":2:1: note: previously declared here", + ":2:1: note: other declaration here", ":6:9: error: local shadows declaration of 'foo'", ":5:1: note: declared here", }); @@ -1211,8 +1211,8 @@ pub fn addCases(ctx: *TestContext) !void { \\var foo = false; \\var foo = true; , &[_][]const u8{ - ":3:5: error: redeclaration of 'foo'", - ":2:1: note: previously declared here", + ":3:1: error: redeclaration of 'foo'", + ":2:1: note: other declaration here", }); ctx.compileError("compileError", linux_x64, @@ -1231,8 +1231,8 @@ pub fn addCases(ctx: *TestContext) !void { \\ unreachable; \\} , &[_][]const u8{ - ":3:9: error: redefinition of 'i'", - ":2:9: note: previous definition is here", + ":3:9: error: redeclaration of 'i'", + ":2:9: note: previously declared here", }); case.addError( \\var testing: i64 = 10; @@ -1240,7 +1240,10 @@ pub fn addCases(ctx: *TestContext) !void { \\ var testing: i64 = 20; \\ unreachable; \\} - , &[_][]const u8{":3:9: error: redefinition of 'testing'"}); + , &[_][]const u8{ + ":3:9: error: local shadows declaration of 'testing'", + ":1:1: note: declared here", + }); } { @@ -1421,10 +1424,12 @@ pub fn addCases(ctx: *TestContext) !void { { var case = ctx.exe("bad inferred variable type", linux_x64); case.addError( - \\export fn foo() void { + \\pub fn main() void { \\ var x = null; \\} - , &[_][]const u8{":2:9: error: variable of type '@Type(.Null)' must be const or comptime"}); + , &[_][]const u8{ + ":2:9: error: variable of type '@Type(.Null)' must be const or comptime", + }); } { |
