authorgravatar for der.teufel.mail@gmail.comKrzysztof Wolicki <der.teufel.mail@gmail.com> 2023-10-25 21:44:33+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-10-26 13:56:43+03:00
loga9e66ed730e17833a3f2701294c01f0b16d206e4
tree6624d2ce517d160cafc208cac406cad6685dab05
parentba817fae8f5f71469ae6ac70fc61b9d3a0e19335

Step.Options: `@typeName` gives a fully qualified name so the test needs to reflect that


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

lib/std/Build/Step/Options.zig+9-11
...@@ -106,10 +106,9 @@ fn addOptionFallible(self: *Options, comptime T: type, name: []const u8, value:...@@ -106,10 +106,9 @@ fn addOptionFallible(self: *Options, comptime T: type, name: []const u8, value:
106 try out.print(" {},\n", .{std.zig.fmtId(field.name)});106 try out.print(" {},\n", .{std.zig.fmtId(field.name)});
107 }107 }
108 try out.writeAll("};\n");108 try out.writeAll("};\n");
109 try out.print("pub const {}: {s} = {s}.{s};\n", .{109 try out.print("pub const {}: {s} = .{s};\n", .{
110 std.zig.fmtId(name),110 std.zig.fmtId(name),
111 std.zig.fmtId(@typeName(T)),111 std.zig.fmtId(@typeName(T)),
112 std.zig.fmtId(@typeName(T)),
113 std.zig.fmtId(@tagName(value)),112 std.zig.fmtId(@tagName(value)),
114 });113 });
115 return;114 return;
...@@ -322,10 +321,9 @@ test Options {...@@ -322,10 +321,9 @@ test Options {
322321
323 const options = builder.addOptions();322 const options = builder.addOptions();
324323
325 // TODO this regressed at some point324 const KeywordEnum = enum {
326 //const KeywordEnum = enum {325 @"0.8.1",
327 // @"0.8.1",326 };
328 //};
329327
330 const nested_array = [2][2]u16{328 const nested_array = [2][2]u16{
331 [2]u16{ 300, 200 },329 [2]u16{ 300, 200 },
...@@ -341,7 +339,7 @@ test Options {...@@ -341,7 +339,7 @@ test Options {
341 options.addOption(?[]const u8, "optional_string", null);339 options.addOption(?[]const u8, "optional_string", null);
342 options.addOption([2][2]u16, "nested_array", nested_array);340 options.addOption([2][2]u16, "nested_array", nested_array);
343 options.addOption([]const []const u16, "nested_slice", nested_slice);341 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");
345 options.addOption(std.SemanticVersion, "semantic_version", try std.SemanticVersion.parse("0.1.2-foo+bar"));343 options.addOption(std.SemanticVersion, "semantic_version", try std.SemanticVersion.parse("0.1.2-foo+bar"));
346344
347 try std.testing.expectEqualStrings(345 try std.testing.expectEqualStrings(
...@@ -371,10 +369,10 @@ test Options {...@@ -371,10 +369,10 @@ test Options {
371 \\ 200,369 \\ 200,
372 \\ },370 \\ },
373 \\};371 \\};
374 //\\pub const KeywordEnum = enum {372 \\pub const @"Build.Step.Options.decltest.Options.KeywordEnum" = enum {
375 //\\ @"0.8.1",373 \\ @"0.8.1",
376 //\\};374 \\};
377 //\\pub const keyword_enum: KeywordEnum = KeywordEnum.@"0.8.1";375 \\pub const keyword_enum: @"Build.Step.Options.decltest.Options.KeywordEnum" = .@"0.8.1";
378 \\pub const semantic_version: @import("std").SemanticVersion = .{376 \\pub const semantic_version: @import("std").SemanticVersion = .{
379 \\ .major = 0,377 \\ .major = 0,
380 \\ .minor = 1,378 \\ .minor = 1,