Skip to content

Commit a9e66ed

Browse files
der-teufel-programmingVexu
authored andcommitted
Step.Options: @typeName gives a fully qualified name so the test needs to reflect that
1 parent ba817fa commit a9e66ed

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lib/std/Build/Step/Options.zig

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,9 @@ fn addOptionFallible(self: *Options, comptime T: type, name: []const u8, value:
106106
try out.print(" {},\n", .{std.zig.fmtId(field.name)});
107107
}
108108
try out.writeAll("};\n");
109-
try out.print("pub const {}: {s} = {s}.{s};\n", .{
109+
try out.print("pub const {}: {s} = .{s};\n", .{
110110
std.zig.fmtId(name),
111111
std.zig.fmtId(@typeName(T)),
112-
std.zig.fmtId(@typeName(T)),
113112
std.zig.fmtId(@tagName(value)),
114113
});
115114
return;
@@ -322,10 +321,9 @@ test Options {
322321

323322
const options = builder.addOptions();
324323

325-
// TODO this regressed at some point
326-
//const KeywordEnum = enum {
327-
// @"0.8.1",
328-
//};
324+
const KeywordEnum = enum {
325+
@"0.8.1",
326+
};
329327

330328
const nested_array = [2][2]u16{
331329
[2]u16{ 300, 200 },
@@ -341,7 +339,7 @@ test Options {
341339
options.addOption(?[]const u8, "optional_string", null);
342340
options.addOption([2][2]u16, "nested_array", nested_array);
343341
options.addOption([]const []const u16, "nested_slice", nested_slice);
344-
//options.addOption(KeywordEnum, "keyword_enum", .@"0.8.1");
342+
options.addOption(KeywordEnum, "keyword_enum", .@"0.8.1");
345343
options.addOption(std.SemanticVersion, "semantic_version", try std.SemanticVersion.parse("0.1.2-foo+bar"));
346344

347345
try std.testing.expectEqualStrings(
@@ -371,10 +369,10 @@ test Options {
371369
\\ 200,
372370
\\ },
373371
\\};
374-
//\\pub const KeywordEnum = enum {
375-
//\\ @"0.8.1",
376-
//\\};
377-
//\\pub const keyword_enum: KeywordEnum = KeywordEnum.@"0.8.1";
372+
\\pub const @"Build.Step.Options.decltest.Options.KeywordEnum" = enum {
373+
\\ @"0.8.1",
374+
\\};
375+
\\pub const keyword_enum: @"Build.Step.Options.decltest.Options.KeywordEnum" = .@"0.8.1";
378376
\\pub const semantic_version: @import("std").SemanticVersion = .{
379377
\\ .major = 0,
380378
\\ .minor = 1,

0 commit comments

Comments
 (0)