| ... | ... | @@ -1,21 +1,20 @@ |
| 1 | | const std = @import("std"); |
| 2 | | const builtin = @import("builtin"); |
| 3 | | const expect = std.testing.expect; |
| 4 | | |
| 5 | | test "@src" { |
| 6 | | // TODO why is this failing on stage1? |
| 7 | | return error.SkipZigTest; |
| 8 | | |
| 9 | | // try doTheTest(); |
| 10 | | } |
| 11 | | |
| 12 | 1 | fn doTheTest() !void { |
| 13 | | const src = @src(); |
| 2 | const src = @src(); // do not move |
| 14 | 3 | |
| 15 | | try expect(src.line == 9); |
| 4 | try expect(src.line == 2); |
| 16 | 5 | try expect(src.column == 17); |
| 17 | 6 | try expect(std.mem.endsWith(u8, src.fn_name, "doTheTest")); |
| 18 | 7 | try expect(std.mem.endsWith(u8, src.file, "src.zig")); |
| 19 | 8 | try expect(src.fn_name[src.fn_name.len] == 0); |
| 20 | 9 | try expect(src.file[src.file.len] == 0); |
| 21 | 10 | } |
| 11 | |
| 12 | const std = @import("std"); |
| 13 | const builtin = @import("builtin"); |
| 14 | const expect = std.testing.expect; |
| 15 | |
| 16 | test "@src" { |
| 17 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; |
| 18 | |
| 19 | try doTheTest(); |
| 20 | } |