Skip to content

Commit 811b171

Browse files
committed
fix tests
1 parent 8bfc203 commit 811b171

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

lib/std/Build/Step/Options.zig

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -505,64 +505,82 @@ test Options {
505505

506506
try std.testing.expectEqualStrings(
507507
\\pub const option1: usize = 1;
508+
\\
508509
\\pub const option2: ?usize = null;
510+
\\
509511
\\pub const option3: ?usize = 3;
512+
\\
510513
\\pub const option4: comptime_int = 4;
514+
\\
511515
\\pub const string: []const u8 = "zigisthebest";
516+
\\
512517
\\pub const optional_string: ?[]const u8 = null;
513-
\\pub const nested_array: [2][2]u16 = [2][2]u16 {
514-
\\ [2]u16 {
518+
\\
519+
\\pub const nested_array: [2][2]u16 = .{
520+
\\ .{
515521
\\ 300,
516522
\\ 200,
517523
\\ },
518-
\\ [2]u16 {
524+
\\ .{
519525
\\ 300,
520526
\\ 200,
521527
\\ },
522528
\\};
523-
\\pub const nested_slice: []const []const u16 = &[_][]const u16 {
524-
\\ &[_]u16 {
529+
\\
530+
\\pub const nested_slice: []const []const u16 = &.{
531+
\\ &.{
525532
\\ 300,
526533
\\ 200,
527534
\\ },
528-
\\ &[_]u16 {
535+
\\ &.{
529536
\\ 300,
530537
\\ 200,
531538
\\ },
532539
\\};
533-
\\pub const @"Build.Step.Options.decltest.Options.KeywordEnum" = enum (u0) {
540+
\\
541+
\\pub const @"Build.Step.Options.decltest.Options.KeywordEnum" = enum(u0) {
534542
\\ @"0.8.1" = 0,
535543
\\};
544+
\\
536545
\\pub const keyword_enum: @"Build.Step.Options.decltest.Options.KeywordEnum" = .@"0.8.1";
546+
\\
537547
\\pub const semantic_version: @import("std").SemanticVersion = .{
538548
\\ .major = 0,
539549
\\ .minor = 1,
540550
\\ .patch = 2,
541551
\\ .pre = "foo",
542552
\\ .build = "bar",
543553
\\};
544-
\\pub const @"Build.Step.Options.decltest.Options.NormalEnum" = enum (u1) {
554+
\\
555+
\\pub const @"Build.Step.Options.decltest.Options.NormalEnum" = enum(u1) {
545556
\\ foo = 0,
546557
\\ bar = 1,
547558
\\};
559+
\\
548560
\\pub const normal1_enum: @"Build.Step.Options.decltest.Options.NormalEnum" = .foo;
561+
\\
549562
\\pub const normal2_enum: @"Build.Step.Options.decltest.Options.NormalEnum" = .bar;
563+
\\
550564
\\pub const @"Build.Step.Options.decltest.Options.NormalStruct" = struct {
551565
\\ hello: ?[]const u8,
552566
\\ world: bool = true,
553567
\\};
568+
\\
554569
\\pub const normal1_struct: @"Build.Step.Options.decltest.Options.NormalStruct" = .{
555570
\\ .hello = "foo",
556571
\\ .world = true,
557572
\\};
573+
\\
558574
\\pub const normal2_struct: @"Build.Step.Options.decltest.Options.NormalStruct" = .{
559575
\\ .hello = null,
560576
\\ .world = false,
561577
\\};
578+
\\
562579
\\pub const @"Build.Step.Options.decltest.Options.NestedStruct" = struct {
563580
\\ normal_struct: @"Build.Step.Options.decltest.Options.NormalStruct",
564581
\\ normal_enum: @"Build.Step.Options.decltest.Options.NormalEnum" = .foo,
565582
\\};
583+
\\
566584
\\pub const nested_struct: @"Build.Step.Options.decltest.Options.NestedStruct" = .{
567585
\\ .normal_struct = .{
568586
\\ .hello = "bar",
@@ -571,6 +589,7 @@ test Options {
571589
\\ .normal_enum = .foo,
572590
\\};
573591
\\
592+
\\
574593
, options.contents.items);
575594

576595
_ = try std.zig.Ast.parse(arena.allocator(), try options.contents.toOwnedSliceSentinel(0), .zig);

0 commit comments

Comments
 (0)