mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 16:12:33 +00:00
4307436b99
And fix test cases to make them pass. This is in preparation for starting to pass behavior tests with self-hosted.
18 lines
407 B
Zig
18 lines
407 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
|
|
test "@src" {
|
|
doTheTest();
|
|
}
|
|
|
|
fn doTheTest() void {
|
|
const src = @src();
|
|
|
|
expect(src.line == 9);
|
|
expect(src.column == 17);
|
|
expect(std.mem.endsWith(u8, src.fn_name, "doTheTest"));
|
|
expect(std.mem.endsWith(u8, src.file, "src.zig"));
|
|
expect(src.fn_name[src.fn_name.len] == 0);
|
|
expect(src.file[src.file.len] == 0);
|
|
}
|