authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-14 00:08:29-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-14 00:08:29-07:00
log9958652d92ee074fbd71a5d75a56341518cc0f99
treeab70c44975a435087674aab07bdb9f617c09337b
parent8344a50e1c545bbeb63debc90cb91289be53b689

stage2: update test cases to improved source locations


1 files changed, 13 insertions(+), 8 deletions(-)

test/stage2/test.zig+13-8
......@@ -1201,7 +1201,7 @@ pub fn addCases(ctx: *TestContext) !void {
12011201 \\}
12021202 , &[_][]const u8{
12031203 ":3:1: error: redeclaration of 'entry'",
1204 ":2:1: note: previously declared here",
1204 ":2:1: note: other declaration here",
12051205 ":6:9: error: local shadows declaration of 'foo'",
12061206 ":5:1: note: declared here",
12071207 });
......@@ -1211,8 +1211,8 @@ pub fn addCases(ctx: *TestContext) !void {
12111211 \\var foo = false;
12121212 \\var foo = true;
12131213 , &[_][]const u8{
1214 ":3:5: error: redeclaration of 'foo'",
1215 ":2:1: note: previously declared here",
1214 ":3:1: error: redeclaration of 'foo'",
1215 ":2:1: note: other declaration here",
12161216 });
12171217
12181218 ctx.compileError("compileError", linux_x64,
......@@ -1231,8 +1231,8 @@ pub fn addCases(ctx: *TestContext) !void {
12311231 \\ unreachable;
12321232 \\}
12331233 , &[_][]const u8{
1234 ":3:9: error: redefinition of 'i'",
1235 ":2:9: note: previous definition is here",
1234 ":3:9: error: redeclaration of 'i'",
1235 ":2:9: note: previously declared here",
12361236 });
12371237 case.addError(
12381238 \\var testing: i64 = 10;
......@@ -1240,7 +1240,10 @@ pub fn addCases(ctx: *TestContext) !void {
12401240 \\ var testing: i64 = 20;
12411241 \\ unreachable;
12421242 \\}
1243 , &[_][]const u8{":3:9: error: redefinition of 'testing'"});
1243 , &[_][]const u8{
1244 ":3:9: error: local shadows declaration of 'testing'",
1245 ":1:1: note: declared here",
1246 });
12441247 }
12451248
12461249 {
......@@ -1421,10 +1424,12 @@ pub fn addCases(ctx: *TestContext) !void {
14211424 {
14221425 var case = ctx.exe("bad inferred variable type", linux_x64);
14231426 case.addError(
1424 \\export fn foo() void {
1427 \\pub fn main() void {
14251428 \\ var x = null;
14261429 \\}
1427 , &[_][]const u8{":2:9: error: variable of type '@Type(.Null)' must be const or comptime"});
1430 , &[_][]const u8{
1431 ":2:9: error: variable of type '@Type(.Null)' must be const or comptime",
1432 });
14281433 }
14291434
14301435 {