parser: reorder tests to match upstream file order
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -543,6 +543,7 @@ fn testCanonical(source: [:0]const u8) !void {
|
||||
}
|
||||
|
||||
|
||||
|
||||
test "zig fmt: remove extra whitespace at start and end of file with comment between" {
|
||||
try testTransform(
|
||||
\\
|
||||
@@ -2723,37 +2724,6 @@ test "zig fmt: nested struct literal with one item" {
|
||||
);
|
||||
}
|
||||
|
||||
test "zig fmt: switch multiline string" {
|
||||
try testCanonical(
|
||||
\\test "switch multiline string" {
|
||||
\\ const x: u32 = 0;
|
||||
\\ const str = switch (x) {
|
||||
\\ 1 => "one",
|
||||
\\ 2 =>
|
||||
\\ \\ Comma after the multiline string
|
||||
\\ \\ is needed
|
||||
\\ ,
|
||||
\\ 3 => "three",
|
||||
\\ else => "else",
|
||||
\\ };
|
||||
\\
|
||||
\\ const Union = union(enum) {
|
||||
\\ Int: i64,
|
||||
\\ Float: f64,
|
||||
\\ };
|
||||
\\
|
||||
\\ const str = switch (u) {
|
||||
\\ Union.Int => |int|
|
||||
\\ \\ Comma after the multiline string
|
||||
\\ \\ is needed
|
||||
\\ ,
|
||||
\\ Union.Float => |*float| unreachable,
|
||||
\\ };
|
||||
\\}
|
||||
\\
|
||||
);
|
||||
}
|
||||
|
||||
test "zig fmt: switch cases trailing comma" {
|
||||
try testTransform(
|
||||
\\test "switch cases trailing comma"{
|
||||
@@ -3778,6 +3748,37 @@ test "zig fmt: switch" {
|
||||
);
|
||||
}
|
||||
|
||||
test "zig fmt: switch multiline string" {
|
||||
try testCanonical(
|
||||
\\test "switch multiline string" {
|
||||
\\ const x: u32 = 0;
|
||||
\\ const str = switch (x) {
|
||||
\\ 1 => "one",
|
||||
\\ 2 =>
|
||||
\\ \\ Comma after the multiline string
|
||||
\\ \\ is needed
|
||||
\\ ,
|
||||
\\ 3 => "three",
|
||||
\\ else => "else",
|
||||
\\ };
|
||||
\\
|
||||
\\ const Union = union(enum) {
|
||||
\\ Int: i64,
|
||||
\\ Float: f64,
|
||||
\\ };
|
||||
\\
|
||||
\\ const str = switch (u) {
|
||||
\\ Union.Int => |int|
|
||||
\\ \\ Comma after the multiline string
|
||||
\\ \\ is needed
|
||||
\\ ,
|
||||
\\ Union.Float => |*float| unreachable,
|
||||
\\ };
|
||||
\\}
|
||||
\\
|
||||
);
|
||||
}
|
||||
|
||||
test "zig fmt: while" {
|
||||
try testCanonical(
|
||||
\\test "while" {
|
||||
@@ -4249,3 +4250,4 @@ test "my function" {
|
||||
\\
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user