authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-02-22 17:37:17+01:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-02-22 17:37:17+01:00
log34c08a91d59a521f81ec5d4d4ee58a73038c286f
treef2ee7c6154230d695c154696b314eb76c39a8c3d
parent928790364ab486de240b8c14ef5ef312079377d7
signaturelock-open Commit is signed but in an unrecognized format.

zig fmt: fix formatting of parser tests


1 files changed, 72 insertions(+), 72 deletions(-)

lib/std/zig/parser_test.zig+72-72
...@@ -87,7 +87,7 @@ test "zig fmt: empty file" {...@@ -87,7 +87,7 @@ test "zig fmt: empty file" {
87test "zig fmt: file ends in comment" {87test "zig fmt: file ends in comment" {
88 try testTransform(88 try testTransform(
89 \\ //foobar89 \\ //foobar
90 ,90 ,
91 \\//foobar91 \\//foobar
92 \\92 \\
93 );93 );
...@@ -2400,18 +2400,18 @@ test "zig fmt: comments before test decl" {...@@ -2400,18 +2400,18 @@ test "zig fmt: comments before test decl" {
2400}2400}
24012401
2402test "zig fmt: preserve spacing" {2402test "zig fmt: preserve spacing" {
2403 try testCanonical(2403 try testCanonical(
2404 \\const std = @import("std");2404 \\const std = @import("std");
2405 \\2405 \\
2406 \\pub fn main() !void {2406 \\pub fn main() !void {
2407 \\ var stdout_file = std.io.getStdOut;2407 \\ var stdout_file = std.io.getStdOut;
2408 \\ var stdout_file = std.io.getStdOut;2408 \\ var stdout_file = std.io.getStdOut;
2409 \\2409 \\
2410 \\ var stdout_file = std.io.getStdOut;2410 \\ var stdout_file = std.io.getStdOut;
2411 \\ var stdout_file = std.io.getStdOut;2411 \\ var stdout_file = std.io.getStdOut;
2412 \\}2412 \\}
2413 \\2413 \\
2414 );2414 );
2415}2415}
24162416
2417//test "zig fmt: return types" {2417//test "zig fmt: return types" {
...@@ -2432,25 +2432,25 @@ test "zig fmt: imports" {...@@ -2432,25 +2432,25 @@ test "zig fmt: imports" {
2432}2432}
24332433
2434test "zig fmt: global declarations" {2434test "zig fmt: global declarations" {
2435 try testCanonical(2435 try testCanonical(
2436 \\const a = b;2436 \\const a = b;
2437 \\pub const a = b;2437 \\pub const a = b;
2438 \\var a = b;2438 \\var a = b;
2439 \\pub var a = b;2439 \\pub var a = b;
2440 \\const a: i32 = b;2440 \\const a: i32 = b;
2441 \\pub const a: i32 = b;2441 \\pub const a: i32 = b;
2442 \\var a: i32 = b;2442 \\var a: i32 = b;
2443 \\pub var a: i32 = b;2443 \\pub var a: i32 = b;
2444 \\extern const a: i32 = b;2444 \\extern const a: i32 = b;
2445 \\pub extern const a: i32 = b;2445 \\pub extern const a: i32 = b;
2446 \\extern var a: i32 = b;2446 \\extern var a: i32 = b;
2447 \\pub extern var a: i32 = b;2447 \\pub extern var a: i32 = b;
2448 \\extern "a" const a: i32 = b;2448 \\extern "a" const a: i32 = b;
2449 \\pub extern "a" const a: i32 = b;2449 \\pub extern "a" const a: i32 = b;
2450 \\extern "a" var a: i32 = b;2450 \\extern "a" var a: i32 = b;
2451 \\pub extern "a" var a: i32 = b;2451 \\pub extern "a" var a: i32 = b;
2452 \\2452 \\
2453 );2453 );
2454}2454}
24552455
2456test "zig fmt: extern declaration" {2456test "zig fmt: extern declaration" {
...@@ -2681,21 +2681,21 @@ test "zig fmt: functions" {...@@ -2681,21 +2681,21 @@ test "zig fmt: functions" {
2681}2681}
26822682
2683test "zig fmt: multiline string" {2683test "zig fmt: multiline string" {
2684 try testCanonical(2684 try testCanonical(
2685 \\test "" {2685 \\test "" {
2686 \\ const s1 =2686 \\ const s1 =
2687 \\ \\one2687 \\ \\one
2688 \\ \\two)2688 \\ \\two)
2689 \\ \\three2689 \\ \\three
2690 \\ ;2690 \\ ;
2691 \\ const s3 = // hi2691 \\ const s3 = // hi
2692 \\ \\one2692 \\ \\one
2693 \\ \\two)2693 \\ \\two)
2694 \\ \\three2694 \\ \\three
2695 \\ ;2695 \\ ;
2696 \\}2696 \\}
2697 \\2697 \\
2698 );2698 );
2699}2699}
27002700
2701test "zig fmt: values" {2701test "zig fmt: values" {
...@@ -3395,17 +3395,17 @@ test "zig fmt: file ends with struct field" {...@@ -3395,17 +3395,17 @@ test "zig fmt: file ends with struct field" {
3395}3395}
33963396
3397test "zig fmt: comment after empty comment" {3397test "zig fmt: comment after empty comment" {
3398 try testTransform(3398 try testTransform(
3399 \\const x = true; //3399 \\const x = true; //
3400 \\//3400 \\//
3401 \\//3401 \\//
3402 \\//a3402 \\//a
3403 \\3403 \\
3404 ,3404 ,
3405 \\const x = true;3405 \\const x = true;
3406 \\//a3406 \\//a
3407 \\3407 \\
3408 );3408 );
3409}3409}
34103410
3411//test "zig fmt: line comment in array" {3411//test "zig fmt: line comment in array" {
...@@ -3579,12 +3579,12 @@ test "zig fmt: comment after empty comment" {...@@ -3579,12 +3579,12 @@ test "zig fmt: comment after empty comment" {
3579//}3579//}
35803580
3581test "zig fmt: extern without container keyword returns error" {3581test "zig fmt: extern without container keyword returns error" {
3582 try testError(3582 try testError(
3583 \\const container = extern {};3583 \\const container = extern {};
3584 \\3584 \\
3585 , &[_]Error{3585 , &[_]Error{
3586 .expected_container,3586 .expected_container,
3587 });3587 });
3588}3588}
35893589
3590test "zig fmt: same line doc comment returns error" {3590test "zig fmt: same line doc comment returns error" {
...@@ -3706,14 +3706,14 @@ test "zig fmt: C var args" {...@@ -3706,14 +3706,14 @@ test "zig fmt: C var args" {
3706//}3706//}
37073707
3708test "zig fmt: Don't add extra newline after if" {3708test "zig fmt: Don't add extra newline after if" {
3709 try testCanonical(3709 try testCanonical(
3710 \\pub fn atomicSymLink(allocator: *Allocator, existing_path: []const u8, new_path: []const u8) !void {3710 \\pub fn atomicSymLink(allocator: *Allocator, existing_path: []const u8, new_path: []const u8) !void {
3711 \\ if (cwd().symLink(existing_path, new_path, .{})) {3711 \\ if (cwd().symLink(existing_path, new_path, .{})) {
3712 \\ return;3712 \\ return;
3713 \\ }3713 \\ }
3714 \\}3714 \\}
3715 \\3715 \\
3716 );3716 );
3717}3717}
37183718
3719//test "zig fmt: comments in ternary ifs" {3719//test "zig fmt: comments in ternary ifs" {