mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 16:12:33 +00:00
re-enable @src
behavior test
This commit is contained in:
parent
92beb2b490
commit
ab4d693cfc
@ -1,21 +1,20 @@
|
||||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const expect = std.testing.expect;
|
||||
|
||||
test "@src" {
|
||||
// TODO why is this failing on stage1?
|
||||
return error.SkipZigTest;
|
||||
|
||||
// try doTheTest();
|
||||
}
|
||||
|
||||
fn doTheTest() !void {
|
||||
const src = @src();
|
||||
const src = @src(); // do not move
|
||||
|
||||
try expect(src.line == 9);
|
||||
try expect(src.line == 2);
|
||||
try expect(src.column == 17);
|
||||
try expect(std.mem.endsWith(u8, src.fn_name, "doTheTest"));
|
||||
try expect(std.mem.endsWith(u8, src.file, "src.zig"));
|
||||
try expect(src.fn_name[src.fn_name.len] == 0);
|
||||
try expect(src.file[src.file.len] == 0);
|
||||
}
|
||||
|
||||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const expect = std.testing.expect;
|
||||
|
||||
test "@src" {
|
||||
if (builtin.zig_backend != .stage1) return error.SkipZigTest;
|
||||
|
||||
try doTheTest();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user