Correct formatting for multiline string in arrays

This commit is contained in:
Timon Kruiper
2019-05-30 00:11:16 +02:00
committed by Andrew Kelley
parent 7bfae39c5c
commit 4e1f3a9ba3
2 changed files with 36 additions and 4 deletions

View File

@@ -2209,6 +2209,25 @@ test "zig fmt: inline asm parameter alignment" {
);
}
test "zig fmt: multiline string in array" {
try testCanonical(
\\const Foo = [][]const u8{
\\ \\aaa
\\,
\\ \\bbb
\\};
\\
\\fn bar() void {
\\ const Foo = [][]const u8{
\\ \\aaa
\\ ,
\\ \\bbb
\\ };
\\}
\\
);
}
const std = @import("std");
const mem = std.mem;
const warn = std.debug.warn;