mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
* stage1: change the `@typeName` of `@TypeOf(undefined)`, `@TypeOf(null)`, and `@TypeOf(.foo)` to match stage2. * move passing behavior tests to the passing-for-stage2 section.
23 lines
599 B
Zig
23 lines
599 B
Zig
const expect = @import("std").testing.expect;
|
|
const expectEqual = @import("std").testing.expectEqual;
|
|
const a_namespace = @import("import/a_namespace.zig");
|
|
|
|
test "call fn via namespace lookup" {
|
|
try expect(@as(i32, 1234) == a_namespace.foo());
|
|
}
|
|
|
|
test "importing the same thing gives the same import" {
|
|
try expect(@import("std") == @import("std"));
|
|
}
|
|
|
|
test "import in non-toplevel scope" {
|
|
const S = struct {
|
|
usingnamespace @import("import/a_namespace.zig");
|
|
};
|
|
try expect(@as(i32, 1234) == S.foo());
|
|
}
|
|
|
|
test "import empty file" {
|
|
_ = @import("import/empty.zig");
|
|
}
|