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 {...@@ -1201,7 +1201,7 @@ pub fn addCases(ctx: *TestContext) !void {
1201 \\}1201 \\}
1202 , &[_][]const u8{1202 , &[_][]const u8{
1203 ":3:1: error: redeclaration of 'entry'",1203 ":3:1: error: redeclaration of 'entry'",
1204 ":2:1: note: previously declared here",1204 ":2:1: note: other declaration here",
1205 ":6:9: error: local shadows declaration of 'foo'",1205 ":6:9: error: local shadows declaration of 'foo'",
1206 ":5:1: note: declared here",1206 ":5:1: note: declared here",
1207 });1207 });
...@@ -1211,8 +1211,8 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -1211,8 +1211,8 @@ pub fn addCases(ctx: *TestContext) !void {
1211 \\var foo = false;1211 \\var foo = false;
1212 \\var foo = true;1212 \\var foo = true;
1213 , &[_][]const u8{1213 , &[_][]const u8{
1214 ":3:5: error: redeclaration of 'foo'",1214 ":3:1: error: redeclaration of 'foo'",
1215 ":2:1: note: previously declared here",1215 ":2:1: note: other declaration here",
1216 });1216 });
12171217
1218 ctx.compileError("compileError", linux_x64,1218 ctx.compileError("compileError", linux_x64,
...@@ -1231,8 +1231,8 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -1231,8 +1231,8 @@ pub fn addCases(ctx: *TestContext) !void {
1231 \\ unreachable;1231 \\ unreachable;
1232 \\}1232 \\}
1233 , &[_][]const u8{1233 , &[_][]const u8{
1234 ":3:9: error: redefinition of 'i'",1234 ":3:9: error: redeclaration of 'i'",
1235 ":2:9: note: previous definition is here",1235 ":2:9: note: previously declared here",
1236 });1236 });
1237 case.addError(1237 case.addError(
1238 \\var testing: i64 = 10;1238 \\var testing: i64 = 10;
...@@ -1240,7 +1240,10 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -1240,7 +1240,10 @@ pub fn addCases(ctx: *TestContext) !void {
1240 \\ var testing: i64 = 20;1240 \\ var testing: i64 = 20;
1241 \\ unreachable;1241 \\ unreachable;
1242 \\}1242 \\}
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 });
1244 }1247 }
12451248
1246 {1249 {
...@@ -1421,10 +1424,12 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -1421,10 +1424,12 @@ pub fn addCases(ctx: *TestContext) !void {
1421 {1424 {
1422 var case = ctx.exe("bad inferred variable type", linux_x64);1425 var case = ctx.exe("bad inferred variable type", linux_x64);
1423 case.addError(1426 case.addError(
1424 \\export fn foo() void {1427 \\pub fn main() void {
1425 \\ var x = null;1428 \\ var x = null;
1426 \\}1429 \\}
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 });
1428 }1433 }
14291434
1430 {1435 {