aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2021-02-23 19:40:34 +0100
committerIsaac Freund <ifreund@ifreund.xyz>2021-02-23 19:40:34 +0100
commitabfe21383035522945e52ffb3954c03398767a39 (patch)
tree54622ce1a4251767c172132b00b2d2724d770839
parent6b9f19a6449b0fe5dce835590fcd6d13b5c785c4 (diff)
downloadzig-abfe21383035522945e52ffb3954c03398767a39.tar.gz
zig-abfe21383035522945e52ffb3954c03398767a39.zip
zig fmt: enable array init trailing comment insertion test
Modify the test case slightly to match similar modifications done in 5820bd0 and 0f24b61.
-rw-r--r--lib/std/zig/parser_test.zig61
1 files changed, 31 insertions, 30 deletions
diff --git a/lib/std/zig/parser_test.zig b/lib/std/zig/parser_test.zig
index 903528c711..72952cde76 100644
--- a/lib/std/zig/parser_test.zig
+++ b/lib/std/zig/parser_test.zig
@@ -3463,36 +3463,37 @@ test "zig fmt: file ends with struct field" {
// );
//}
-//test "zig fmt: line comment in array" {
-// try testTransform(
-// \\test "a" {
-// \\ var arr = [_]u32{
-// \\ 0
-// \\ // 1,
-// \\ // 2,
-// \\ };
-// \\}
-// \\
-// ,
-// \\test "a" {
-// \\ var arr = [_]u32{
-// \\ 0, // 1,
-// \\ // 2,
-// \\ };
-// \\}
-// \\
-// );
-// try testCanonical(
-// \\test "a" {
-// \\ var arr = [_]u32{
-// \\ 0,
-// \\ // 1,
-// \\ // 2,
-// \\ };
-// \\}
-// \\
-// );
-//}
+test "zig fmt: line comment in array" {
+ try testTransform(
+ \\test "a" {
+ \\ var arr = [_]u32{
+ \\ 0
+ \\ // 1,
+ \\ // 2,
+ \\ };
+ \\}
+ \\
+ ,
+ \\test "a" {
+ \\ var arr = [_]u32{
+ \\ 0,
+ \\ // 1,
+ \\ // 2,
+ \\ };
+ \\}
+ \\
+ );
+ try testCanonical(
+ \\test "a" {
+ \\ var arr = [_]u32{
+ \\ 0,
+ \\ // 1,
+ \\ // 2,
+ \\ };
+ \\}
+ \\
+ );
+}
test "zig fmt: comment after params" {
try testTransform(