diff options
| author | Veikka Tuominen <git@vexu.eu> | 2023-01-03 19:37:11 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-01-05 02:31:29 -0700 |
| commit | f83834993e2628e347da71a11ffb07c804fc46c5 (patch) | |
| tree | 21fd10b3ba19c4236326549872a202a4ffe29b3f /test | |
| parent | fe2bd9dda8467b775da4fe3bd535aece9e07ee1b (diff) | |
| download | zig-f83834993e2628e347da71a11ffb07c804fc46c5.tar.gz zig-f83834993e2628e347da71a11ffb07c804fc46c5.zip | |
std: collect all options under one namespace
Diffstat (limited to 'test')
| -rw-r--r-- | test/behavior/pointers.zig | 4 | ||||
| -rw-r--r-- | test/compare_output.zig | 18 | ||||
| -rw-r--r-- | test/standalone/issue_7030/main.zig | 4 | ||||
| -rw-r--r-- | test/standalone/issue_9693/main.zig | 4 |
4 files changed, 21 insertions, 9 deletions
diff --git a/test/behavior/pointers.zig b/test/behavior/pointers.zig index 36f70e1a77..e718169731 100644 --- a/test/behavior/pointers.zig +++ b/test/behavior/pointers.zig @@ -509,8 +509,8 @@ test "ptrCast comptime known slice to C pointer" { test "ptrToInt on a generic function" { if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_aarch64 and builtin.os.tag != .linux) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag != .linux) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO + if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO const S = struct { fn generic(i: anytype) @TypeOf(i) { diff --git a/test/compare_output.zig b/test/compare_output.zig index c2bfdf8062..b3a6144729 100644 --- a/test/compare_output.zig +++ b/test/compare_output.zig @@ -440,11 +440,14 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { cases.add("std.log per scope log level override", \\const std = @import("std"); \\ - \\pub const log_level: std.log.Level = .debug; - \\ - \\pub const scope_levels = [_]std.log.ScopeLevel{ - \\ .{ .scope = .a, .level = .warn }, - \\ .{ .scope = .c, .level = .err }, + \\pub const std_options = struct { + \\ pub const log_level: std.log.Level = .debug; + \\ + \\ pub const log_scope_levels = &[_]std.log.ScopeLevel{ + \\ .{ .scope = .a, .level = .warn }, + \\ .{ .scope = .c, .level = .err }, + \\ }; + \\ pub const logFn = log; \\}; \\ \\const loga = std.log.scoped(.a); @@ -494,7 +497,10 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { cases.add("std.heap.LoggingAllocator logs to std.log", \\const std = @import("std"); \\ - \\pub const log_level: std.log.Level = .debug; + \\pub const std_options = struct { + \\ pub const log_level: std.log.Level = .debug; + \\ pub const logFn = log; + \\}; \\ \\pub fn main() !void { \\ var allocator_buf: [10]u8 = undefined; diff --git a/test/standalone/issue_7030/main.zig b/test/standalone/issue_7030/main.zig index 4cf79a7b31..8a4146e84a 100644 --- a/test/standalone/issue_7030/main.zig +++ b/test/standalone/issue_7030/main.zig @@ -1,5 +1,9 @@ const std = @import("std"); +pub const std_options = struct { + pub const logFn = log; +}; + pub fn log( comptime message_level: std.log.Level, comptime scope: @Type(.EnumLiteral), diff --git a/test/standalone/issue_9693/main.zig b/test/standalone/issue_9693/main.zig index ecf410a1ca..19e9c5b96c 100644 --- a/test/standalone/issue_9693/main.zig +++ b/test/standalone/issue_9693/main.zig @@ -1,2 +1,4 @@ -pub const io_mode = .evented; +pub const std_options = struct { + pub const io_mode = .evented; +}; pub fn main() void {} |
