| ... | ... | @@ -4270,6 +4270,69 @@ test "zig fmt: remove newlines surrounding doc comment" { |
| 4270 | 4270 | ); |
| 4271 | 4271 | } |
| 4272 | 4272 | |
| 4273 | test "zig fmt: remove newlines surrounding doc comment between members" { |
| 4274 | try testTransform( |
| 4275 | \\f1: i32, |
| 4276 | \\ |
| 4277 | \\ |
| 4278 | \\/// doc comment |
| 4279 | \\ |
| 4280 | \\f2: i32, |
| 4281 | \\ |
| 4282 | , |
| 4283 | \\f1: i32, |
| 4284 | \\ |
| 4285 | \\/// doc comment |
| 4286 | \\f2: i32, |
| 4287 | \\ |
| 4288 | ); |
| 4289 | } |
| 4290 | |
| 4291 | test "zig fmt: remove newlines surrounding doc comment between members within container decl (1)" { |
| 4292 | try testTransform( |
| 4293 | \\const Foo = struct { |
| 4294 | \\ fn foo() void {} |
| 4295 | \\ |
| 4296 | \\ |
| 4297 | \\ /// doc comment |
| 4298 | \\ |
| 4299 | \\ |
| 4300 | \\ fn bar() void {} |
| 4301 | \\}; |
| 4302 | \\ |
| 4303 | , |
| 4304 | \\const Foo = struct { |
| 4305 | \\ fn foo() void {} |
| 4306 | \\ |
| 4307 | \\ /// doc comment |
| 4308 | \\ fn bar() void {} |
| 4309 | \\}; |
| 4310 | \\ |
| 4311 | ); |
| 4312 | } |
| 4313 | |
| 4314 | test "zig fmt: remove newlines surrounding doc comment between members within container decl (2)" { |
| 4315 | try testTransform( |
| 4316 | \\const Foo = struct { |
| 4317 | \\ fn foo() void {} |
| 4318 | \\ /// doc comment 1 |
| 4319 | \\ |
| 4320 | \\ /// doc comment 2 |
| 4321 | \\ |
| 4322 | \\ fn bar() void {} |
| 4323 | \\}; |
| 4324 | \\ |
| 4325 | , |
| 4326 | \\const Foo = struct { |
| 4327 | \\ fn foo() void {} |
| 4328 | \\ /// doc comment 1 |
| 4329 | \\ /// doc comment 2 |
| 4330 | \\ fn bar() void {} |
| 4331 | \\}; |
| 4332 | \\ |
| 4333 | ); |
| 4334 | } |
| 4335 | |
| 4273 | 4336 | test "zig fmt: remove newlines surrounding doc comment within container decl" { |
| 4274 | 4337 | try testTransform( |
| 4275 | 4338 | \\const Foo = struct { |