@@ -1299,50 +1299,6 @@ pub fn addCliTests(b: *std.Build) *Step {
1299
1299
});
1300
1300
check6 .step .dependOn (& run6 .step );
1301
1301
1302
- // Test `zig fmt` handling switch expressions in array initializers
1303
- const switch_in_array_code =
1304
- \\const bar = .{ .{ switch ({}) {
1305
- \\ else => {},
1306
- \\ } }, .{}, .{}, .{},
1307
- \\};
1308
- \\
1309
- ;
1310
-
1311
- const fmt7_path = b .pathJoin (&.{ tmp_path , "fmt7.zig" });
1312
- const write7 = b .addUpdateSourceFiles ();
1313
- write7 .addBytesToSource (switch_in_array_code , fmt7_path );
1314
- write7 .step .dependOn (& check6 .step );
1315
-
1316
- // Test `zig fmt` handling switch expressions in array initializers
1317
- const run7 = b .addSystemCommand (&.{ b .graph .zig_exe , "fmt" , "fmt7.zig" });
1318
- run7 .setName ("run zig fmt on array with switch" );
1319
- run7 .setCwd (.{ .cwd_relative = tmp_path });
1320
- run7 .has_side_effects = true ;
1321
- run7 .expectStdOutEqual ("fmt7.zig\n " );
1322
- run7 .step .dependOn (& write7 .step );
1323
-
1324
- // Check that the file is formatted correctly after a single fmt invocation
1325
- const check7 = b .addCheckFile (.{ .cwd_relative = fmt7_path }, .{
1326
- .expected_matches = &.{
1327
- "const bar = .{" ,
1328
- " .{switch ({}) {" ,
1329
- " else => {}," ,
1330
- " }}," ,
1331
- " .{}," ,
1332
- " .{}," ,
1333
- " .{}," ,
1334
- "};" ,
1335
- },
1336
- });
1337
- check7 .step .dependOn (& run7 .step );
1338
-
1339
- // Run fmt again to verify that no further changes are made (idempotence)
1340
- const run8 = b .addSystemCommand (&.{ b .graph .zig_exe , "fmt" , "fmt7.zig" });
1341
- run8 .setName ("run zig fmt again on array with switch" );
1342
- run8 .setCwd (.{ .cwd_relative = tmp_path });
1343
- run8 .has_side_effects = true ;
1344
- run8 .step .dependOn (& check7 .step );
1345
-
1346
1302
const cleanup = b .addRemoveDirTree (.{ .cwd_relative = tmp_path });
1347
1303
cleanup .step .dependOn (& check6 .step );
1348
1304
0 commit comments