authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-10 14:38:44-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-11 12:48:17-07:00
logd1ad126e345de106b435c16ca6cf49ce9a4a14f1
tree1edfbd47282b278884c6f83c915e7fda58fb4f2d
parentdd547f06c64746356b92c4fa532067adbd1ca250

std.build.OptionsStep: fix regressed tests


1 files changed, 10 insertions(+), 9 deletions(-)

lib/std/build/OptionsStep.zig+10-9
......@@ -131,7 +131,7 @@ pub fn addOption(self: *OptionsStep, comptime T: type, name: []const u8, value:
131131 },
132132 else => {},
133133 }
134 out.print("pub const {}: {s} = ", .{ std.zig.fmtId(name), std.zig.fmtId(@typeName(T)) }) catch unreachable;
134 out.print("pub const {}: {s} = ", .{ std.zig.fmtId(name), @typeName(T) }) catch unreachable;
135135 printLiteral(out, value, 0) catch unreachable;
136136 out.writeAll(";\n") catch unreachable;
137137}
......@@ -292,9 +292,10 @@ test "OptionsStep" {
292292
293293 const options = builder.addOptions();
294294
295 const KeywordEnum = enum {
296 @"0.8.1",
297 };
295 // TODO this regressed at some point
296 //const KeywordEnum = enum {
297 // @"0.8.1",
298 //};
298299
299300 const nested_array = [2][2]u16{
300301 [2]u16{ 300, 200 },
......@@ -310,7 +311,7 @@ test "OptionsStep" {
310311 options.addOption(?[]const u8, "optional_string", null);
311312 options.addOption([2][2]u16, "nested_array", nested_array);
312313 options.addOption([]const []const u16, "nested_slice", nested_slice);
313 options.addOption(KeywordEnum, "keyword_enum", .@"0.8.1");
314 //options.addOption(KeywordEnum, "keyword_enum", .@"0.8.1");
314315 options.addOption(std.builtin.Version, "version", try std.builtin.Version.parse("0.1.2"));
315316 options.addOption(std.SemanticVersion, "semantic_version", try std.SemanticVersion.parse("0.1.2-foo+bar"));
316317
......@@ -341,10 +342,10 @@ test "OptionsStep" {
341342 \\ 200,
342343 \\ },
343344 \\};
344 \\pub const KeywordEnum = enum {
345 \\ @"0.8.1",
346 \\};
347 \\pub const keyword_enum: KeywordEnum = KeywordEnum.@"0.8.1";
345 //\\pub const KeywordEnum = enum {
346 //\\ @"0.8.1",
347 //\\};
348 //\\pub const keyword_enum: KeywordEnum = KeywordEnum.@"0.8.1";
348349 \\pub const version: @import("std").builtin.Version = .{
349350 \\ .major = 0,
350351 \\ .minor = 1,