| ... | ... | @@ -26,6 +26,8 @@ test "zig fmt: tuple struct" { |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | test "zig fmt: preserves clobbers in inline asm with stray comma" { |
| 29 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 30 | |
| 29 | 31 | try testCanonical( |
| 30 | 32 | \\fn foo() void { |
| 31 | 33 | \\ asm volatile ("" |
| ... | ... | @@ -44,6 +46,8 @@ test "zig fmt: preserves clobbers in inline asm with stray comma" { |
| 44 | 46 | } |
| 45 | 47 | |
| 46 | 48 | test "zig fmt: remove trailing comma at the end of assembly clobber" { |
| 49 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 50 | |
| 47 | 51 | try testTransform( |
| 48 | 52 | \\fn foo() void { |
| 49 | 53 | \\ asm volatile ("" |
| ... | ... | @@ -66,6 +70,8 @@ test "zig fmt: remove trailing comma at the end of assembly clobber" { |
| 66 | 70 | } |
| 67 | 71 | |
| 68 | 72 | test "zig fmt: respect line breaks in struct field value declaration" { |
| 73 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 74 | |
| 69 | 75 | try testCanonical( |
| 70 | 76 | \\const Foo = struct { |
| 71 | 77 | \\ bar: u32 = |
| ... | ... | @@ -220,6 +226,8 @@ test "zig fmt: file ends in comment after var decl" { |
| 220 | 226 | } |
| 221 | 227 | |
| 222 | 228 | test "zig fmt: if statement" { |
| 229 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 230 | |
| 223 | 231 | try testCanonical( |
| 224 | 232 | \\test "" { |
| 225 | 233 | \\ if (optional()) |some| |
| ... | ... | @@ -318,6 +326,8 @@ test "zig fmt: decl between fields" { |
| 318 | 326 | } |
| 319 | 327 | |
| 320 | 328 | test "zig fmt: errdefer with payload" { |
| 329 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 330 | |
| 321 | 331 | try testCanonical( |
| 322 | 332 | \\pub fn main() anyerror!void { |
| 323 | 333 | \\ errdefer |a| x += 1; |
| ... | ... | @@ -331,6 +341,8 @@ test "zig fmt: errdefer with payload" { |
| 331 | 341 | } |
| 332 | 342 | |
| 333 | 343 | test "zig fmt: nosuspend block" { |
| 344 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 345 | |
| 334 | 346 | try testCanonical( |
| 335 | 347 | \\pub fn main() anyerror!void { |
| 336 | 348 | \\ nosuspend { |
| ... | ... | @@ -342,6 +354,8 @@ test "zig fmt: nosuspend block" { |
| 342 | 354 | } |
| 343 | 355 | |
| 344 | 356 | test "zig fmt: nosuspend await" { |
| 357 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 358 | |
| 345 | 359 | try testCanonical( |
| 346 | 360 | \\fn foo() void { |
| 347 | 361 | \\ x = nosuspend await y; |
| ... | ... | @@ -362,6 +376,8 @@ test "zig fmt: container declaration, single line" { |
| 362 | 376 | } |
| 363 | 377 | |
| 364 | 378 | test "zig fmt: container declaration, one item, multi line trailing comma" { |
| 379 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 380 | |
| 365 | 381 | try testCanonical( |
| 366 | 382 | \\test "" { |
| 367 | 383 | \\ comptime { |
| ... | ... | @@ -375,6 +391,8 @@ test "zig fmt: container declaration, one item, multi line trailing comma" { |
| 375 | 391 | } |
| 376 | 392 | |
| 377 | 393 | test "zig fmt: container declaration, no trailing comma on separate line" { |
| 394 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 395 | |
| 378 | 396 | try testTransform( |
| 379 | 397 | \\test "" { |
| 380 | 398 | \\ comptime { |
| ... | ... | @@ -501,6 +519,8 @@ test "zig fmt: remove empty lines at start/end of container decl" { |
| 501 | 519 | } |
| 502 | 520 | |
| 503 | 521 | test "zig fmt: remove empty lines at start/end of block" { |
| 522 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 523 | |
| 504 | 524 | try testTransform( |
| 505 | 525 | \\test { |
| 506 | 526 | \\ |
| ... | ... | @@ -521,6 +541,8 @@ test "zig fmt: remove empty lines at start/end of block" { |
| 521 | 541 | } |
| 522 | 542 | |
| 523 | 543 | test "zig fmt: allow empty line before comment at start of block" { |
| 544 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 545 | |
| 524 | 546 | try testCanonical( |
| 525 | 547 | \\test { |
| 526 | 548 | \\ |
| ... | ... | @@ -584,6 +606,8 @@ test "zig fmt: comptime struct field" { |
| 584 | 606 | } |
| 585 | 607 | |
| 586 | 608 | test "zig fmt: break from block" { |
| 609 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 610 | |
| 587 | 611 | try testCanonical( |
| 588 | 612 | \\const a = blk: { |
| 589 | 613 | \\ break :blk 42; |
| ... | ... | @@ -616,6 +640,8 @@ test "zig fmt: c pointer type" { |
| 616 | 640 | } |
| 617 | 641 | |
| 618 | 642 | test "zig fmt: builtin call with trailing comma" { |
| 643 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 644 | |
| 619 | 645 | try testCanonical( |
| 620 | 646 | \\pub fn main() void { |
| 621 | 647 | \\ @breakpoint(); |
| ... | ... | @@ -631,6 +657,8 @@ test "zig fmt: builtin call with trailing comma" { |
| 631 | 657 | } |
| 632 | 658 | |
| 633 | 659 | test "zig fmt: asm expression with comptime content" { |
| 660 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 661 | |
| 634 | 662 | try testCanonical( |
| 635 | 663 | \\comptime { |
| 636 | 664 | \\ asm ("foo" ++ "bar"); |
| ... | ... | @@ -655,6 +683,8 @@ test "zig fmt: asm expression with comptime content" { |
| 655 | 683 | } |
| 656 | 684 | |
| 657 | 685 | test "zig fmt: array types last token" { |
| 686 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 687 | |
| 658 | 688 | try testCanonical( |
| 659 | 689 | \\test { |
| 660 | 690 | \\ const x = [40]u32; |
| ... | ... | @@ -668,6 +698,8 @@ test "zig fmt: array types last token" { |
| 668 | 698 | } |
| 669 | 699 | |
| 670 | 700 | test "zig fmt: sentinel-terminated array type" { |
| 701 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 702 | |
| 671 | 703 | try testCanonical( |
| 672 | 704 | \\pub fn cStrToPrefixedFileW(s: [*:0]const u8) ![PATH_MAX_WIDE:0]u16 { |
| 673 | 705 | \\ return sliceToPrefixedFileW(mem.toSliceConst(u8, s)); |
| ... | ... | @@ -677,6 +709,8 @@ test "zig fmt: sentinel-terminated array type" { |
| 677 | 709 | } |
| 678 | 710 | |
| 679 | 711 | test "zig fmt: sentinel-terminated slice type" { |
| 712 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 713 | |
| 680 | 714 | try testCanonical( |
| 681 | 715 | \\pub fn toSlice(self: Buffer) [:0]u8 { |
| 682 | 716 | \\ return self.list.toSlice()[0..self.len()]; |
| ... | ... | @@ -748,6 +782,8 @@ test "zig fmt: anon literal in array" { |
| 748 | 782 | } |
| 749 | 783 | |
| 750 | 784 | test "zig fmt: alignment in anonymous literal" { |
| 785 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 786 | |
| 751 | 787 | try testTransform( |
| 752 | 788 | \\const a = .{ |
| 753 | 789 | \\ "U", "L", "F", |
| ... | ... | @@ -766,6 +802,8 @@ test "zig fmt: alignment in anonymous literal" { |
| 766 | 802 | } |
| 767 | 803 | |
| 768 | 804 | test "zig fmt: anon struct literal 0 element" { |
| 805 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 806 | |
| 769 | 807 | try testCanonical( |
| 770 | 808 | \\test { |
| 771 | 809 | \\ const x = .{}; |
| ... | ... | @@ -775,6 +813,8 @@ test "zig fmt: anon struct literal 0 element" { |
| 775 | 813 | } |
| 776 | 814 | |
| 777 | 815 | test "zig fmt: anon struct literal 1 element" { |
| 816 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 817 | |
| 778 | 818 | try testCanonical( |
| 779 | 819 | \\test { |
| 780 | 820 | \\ const x = .{ .a = b }; |
| ... | ... | @@ -784,6 +824,8 @@ test "zig fmt: anon struct literal 1 element" { |
| 784 | 824 | } |
| 785 | 825 | |
| 786 | 826 | test "zig fmt: anon struct literal 1 element comma" { |
| 827 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 828 | |
| 787 | 829 | try testCanonical( |
| 788 | 830 | \\test { |
| 789 | 831 | \\ const x = .{ |
| ... | ... | @@ -795,6 +837,8 @@ test "zig fmt: anon struct literal 1 element comma" { |
| 795 | 837 | } |
| 796 | 838 | |
| 797 | 839 | test "zig fmt: anon struct literal 2 element" { |
| 840 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 841 | |
| 798 | 842 | try testCanonical( |
| 799 | 843 | \\test { |
| 800 | 844 | \\ const x = .{ .a = b, .c = d }; |
| ... | ... | @@ -804,6 +848,8 @@ test "zig fmt: anon struct literal 2 element" { |
| 804 | 848 | } |
| 805 | 849 | |
| 806 | 850 | test "zig fmt: anon struct literal 2 element comma" { |
| 851 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 852 | |
| 807 | 853 | try testCanonical( |
| 808 | 854 | \\test { |
| 809 | 855 | \\ const x = .{ |
| ... | ... | @@ -816,6 +862,8 @@ test "zig fmt: anon struct literal 2 element comma" { |
| 816 | 862 | } |
| 817 | 863 | |
| 818 | 864 | test "zig fmt: anon struct literal 3 element" { |
| 865 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 866 | |
| 819 | 867 | try testCanonical( |
| 820 | 868 | \\test { |
| 821 | 869 | \\ const x = .{ .a = b, .c = d, .e = f }; |
| ... | ... | @@ -825,6 +873,8 @@ test "zig fmt: anon struct literal 3 element" { |
| 825 | 873 | } |
| 826 | 874 | |
| 827 | 875 | test "zig fmt: anon struct literal 3 element comma" { |
| 876 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 877 | |
| 828 | 878 | try testCanonical( |
| 829 | 879 | \\test { |
| 830 | 880 | \\ const x = .{ |
| ... | ... | @@ -838,6 +888,8 @@ test "zig fmt: anon struct literal 3 element comma" { |
| 838 | 888 | } |
| 839 | 889 | |
| 840 | 890 | test "zig fmt: struct literal 0 element" { |
| 891 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 892 | |
| 841 | 893 | try testCanonical( |
| 842 | 894 | \\test { |
| 843 | 895 | \\ const x = X{}; |
| ... | ... | @@ -847,6 +899,8 @@ test "zig fmt: struct literal 0 element" { |
| 847 | 899 | } |
| 848 | 900 | |
| 849 | 901 | test "zig fmt: struct literal 1 element" { |
| 902 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 903 | |
| 850 | 904 | try testCanonical( |
| 851 | 905 | \\test { |
| 852 | 906 | \\ const x = X{ .a = b }; |
| ... | ... | @@ -856,6 +910,8 @@ test "zig fmt: struct literal 1 element" { |
| 856 | 910 | } |
| 857 | 911 | |
| 858 | 912 | test "zig fmt: Unicode code point literal larger than u8" { |
| 913 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 914 | |
| 859 | 915 | try testCanonical( |
| 860 | 916 | \\test { |
| 861 | 917 | \\ const x = X{ |
| ... | ... | @@ -867,6 +923,8 @@ test "zig fmt: Unicode code point literal larger than u8" { |
| 867 | 923 | } |
| 868 | 924 | |
| 869 | 925 | test "zig fmt: struct literal 2 element" { |
| 926 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 927 | |
| 870 | 928 | try testCanonical( |
| 871 | 929 | \\test { |
| 872 | 930 | \\ const x = X{ .a = b, .c = d }; |
| ... | ... | @@ -876,6 +934,8 @@ test "zig fmt: struct literal 2 element" { |
| 876 | 934 | } |
| 877 | 935 | |
| 878 | 936 | test "zig fmt: struct literal 2 element comma" { |
| 937 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 938 | |
| 879 | 939 | try testCanonical( |
| 880 | 940 | \\test { |
| 881 | 941 | \\ const x = X{ |
| ... | ... | @@ -888,6 +948,8 @@ test "zig fmt: struct literal 2 element comma" { |
| 888 | 948 | } |
| 889 | 949 | |
| 890 | 950 | test "zig fmt: struct literal 3 element" { |
| 951 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 952 | |
| 891 | 953 | try testCanonical( |
| 892 | 954 | \\test { |
| 893 | 955 | \\ const x = X{ .a = b, .c = d, .e = f }; |
| ... | ... | @@ -897,6 +959,8 @@ test "zig fmt: struct literal 3 element" { |
| 897 | 959 | } |
| 898 | 960 | |
| 899 | 961 | test "zig fmt: struct literal 3 element comma" { |
| 962 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 963 | |
| 900 | 964 | try testCanonical( |
| 901 | 965 | \\test { |
| 902 | 966 | \\ const x = X{ |
| ... | ... | @@ -910,6 +974,8 @@ test "zig fmt: struct literal 3 element comma" { |
| 910 | 974 | } |
| 911 | 975 | |
| 912 | 976 | test "zig fmt: anon list literal 1 element" { |
| 977 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 978 | |
| 913 | 979 | try testCanonical( |
| 914 | 980 | \\test { |
| 915 | 981 | \\ const x = .{a}; |
| ... | ... | @@ -930,6 +996,8 @@ test "zig fmt: anon list literal 1 element comma" { |
| 930 | 996 | } |
| 931 | 997 | |
| 932 | 998 | test "zig fmt: anon list literal 2 element" { |
| 999 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1000 | |
| 933 | 1001 | try testCanonical( |
| 934 | 1002 | \\test { |
| 935 | 1003 | \\ const x = .{ a, b }; |
| ... | ... | @@ -951,6 +1019,8 @@ test "zig fmt: anon list literal 2 element comma" { |
| 951 | 1019 | } |
| 952 | 1020 | |
| 953 | 1021 | test "zig fmt: anon list literal 3 element" { |
| 1022 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1023 | |
| 954 | 1024 | try testCanonical( |
| 955 | 1025 | \\test { |
| 956 | 1026 | \\ const x = .{ a, b, c }; |
| ... | ... | @@ -975,6 +1045,8 @@ test "zig fmt: anon list literal 3 element comma" { |
| 975 | 1045 | } |
| 976 | 1046 | |
| 977 | 1047 | test "zig fmt: array literal 0 element" { |
| 1048 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1049 | |
| 978 | 1050 | try testCanonical( |
| 979 | 1051 | \\test { |
| 980 | 1052 | \\ const x = [_]u32{}; |
| ... | ... | @@ -984,6 +1056,8 @@ test "zig fmt: array literal 0 element" { |
| 984 | 1056 | } |
| 985 | 1057 | |
| 986 | 1058 | test "zig fmt: array literal 1 element" { |
| 1059 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1060 | |
| 987 | 1061 | try testCanonical( |
| 988 | 1062 | \\test { |
| 989 | 1063 | \\ const x = [_]u32{a}; |
| ... | ... | @@ -1004,6 +1078,8 @@ test "zig fmt: array literal 1 element comma" { |
| 1004 | 1078 | } |
| 1005 | 1079 | |
| 1006 | 1080 | test "zig fmt: array literal 2 element" { |
| 1081 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1082 | |
| 1007 | 1083 | try testCanonical( |
| 1008 | 1084 | \\test { |
| 1009 | 1085 | \\ const x = [_]u32{ a, b }; |
| ... | ... | @@ -1025,6 +1101,8 @@ test "zig fmt: array literal 2 element comma" { |
| 1025 | 1101 | } |
| 1026 | 1102 | |
| 1027 | 1103 | test "zig fmt: array literal 3 element" { |
| 1104 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1105 | |
| 1028 | 1106 | try testCanonical( |
| 1029 | 1107 | \\test { |
| 1030 | 1108 | \\ const x = [_]u32{ a, b, c }; |
| ... | ... | @@ -1047,6 +1125,8 @@ test "zig fmt: array literal 3 element comma" { |
| 1047 | 1125 | } |
| 1048 | 1126 | |
| 1049 | 1127 | test "zig fmt: sentinel array literal 1 element" { |
| 1128 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1129 | |
| 1050 | 1130 | try testCanonical( |
| 1051 | 1131 | \\test { |
| 1052 | 1132 | \\ const x = [_:9000]u32{a}; |
| ... | ... | @@ -1076,6 +1156,8 @@ test "zig fmt: slices with spaces in bounds" { |
| 1076 | 1156 | } |
| 1077 | 1157 | |
| 1078 | 1158 | test "zig fmt: block in slice expression" { |
| 1159 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1160 | |
| 1079 | 1161 | try testCanonical( |
| 1080 | 1162 | \\const a = b[{ |
| 1081 | 1163 | \\ _ = x; |
| ... | ... | @@ -1094,6 +1176,8 @@ test "zig fmt: block in slice expression" { |
| 1094 | 1176 | } |
| 1095 | 1177 | |
| 1096 | 1178 | test "zig fmt: async function" { |
| 1179 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1180 | |
| 1097 | 1181 | try testCanonical( |
| 1098 | 1182 | \\pub const Server = struct { |
| 1099 | 1183 | \\ handleRequestFn: fn (*Server, *const std.net.Address, File) callconv(.Async) void, |
| ... | ... | @@ -1106,6 +1190,8 @@ test "zig fmt: async function" { |
| 1106 | 1190 | } |
| 1107 | 1191 | |
| 1108 | 1192 | test "zig fmt: whitespace fixes" { |
| 1193 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1194 | |
| 1109 | 1195 | try testTransform("test \"\" {\r\n\tconst hi = x;\r\n}\n// zig fmt: off\ntest \"\"{\r\n\tconst a = b;}\r\n", |
| 1110 | 1196 | \\test "" { |
| 1111 | 1197 | \\ const hi = x; |
| ... | ... | @@ -1118,6 +1204,8 @@ test "zig fmt: whitespace fixes" { |
| 1118 | 1204 | } |
| 1119 | 1205 | |
| 1120 | 1206 | test "zig fmt: while else err prong with no block" { |
| 1207 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1208 | |
| 1121 | 1209 | try testCanonical( |
| 1122 | 1210 | \\test "" { |
| 1123 | 1211 | \\ const result = while (returnError()) |value| { |
| ... | ... | @@ -1147,6 +1235,8 @@ test "zig fmt: tagged union with enum values" { |
| 1147 | 1235 | } |
| 1148 | 1236 | |
| 1149 | 1237 | test "zig fmt: tagged union enum tag last token" { |
| 1238 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1239 | |
| 1150 | 1240 | try testCanonical( |
| 1151 | 1241 | \\test { |
| 1152 | 1242 | \\ const U = union(enum(u32)) {}; |
| ... | ... | @@ -1482,6 +1572,8 @@ test "zig fmt: doc and line comment following 'zig fmt: on'" { |
| 1482 | 1572 | } |
| 1483 | 1573 | |
| 1484 | 1574 | test "zig fmt: 'zig fmt: (off|on)' works in the middle of code" { |
| 1575 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1576 | |
| 1485 | 1577 | try testTransform( |
| 1486 | 1578 | \\test "" { |
| 1487 | 1579 | \\ const x = 42; |
| ... | ... | @@ -1508,6 +1600,8 @@ test "zig fmt: 'zig fmt: (off|on)' works in the middle of code" { |
| 1508 | 1600 | } |
| 1509 | 1601 | |
| 1510 | 1602 | test "zig fmt: 'zig fmt: on' indentation is unchanged" { |
| 1603 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1604 | |
| 1511 | 1605 | try testCanonical( |
| 1512 | 1606 | \\fn initOptionsAndLayouts(output: *Output, context: *Context) !void { |
| 1513 | 1607 | \\ // zig fmt: off |
| ... | ... | @@ -1550,6 +1644,8 @@ test "zig fmt: spaces around slice operator" { |
| 1550 | 1644 | } |
| 1551 | 1645 | |
| 1552 | 1646 | test "zig fmt: async call in if condition" { |
| 1647 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1648 | |
| 1553 | 1649 | try testCanonical( |
| 1554 | 1650 | \\comptime { |
| 1555 | 1651 | \\ if (async b()) { |
| ... | ... | @@ -1561,6 +1657,8 @@ test "zig fmt: async call in if condition" { |
| 1561 | 1657 | } |
| 1562 | 1658 | |
| 1563 | 1659 | test "zig fmt: 2nd arg multiline string" { |
| 1660 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1661 | |
| 1564 | 1662 | try testCanonical( |
| 1565 | 1663 | \\comptime { |
| 1566 | 1664 | \\ cases.addAsm("hello world linux x86_64", |
| ... | ... | @@ -1589,6 +1687,8 @@ test "zig fmt: 2nd arg multiline string" { |
| 1589 | 1687 | } |
| 1590 | 1688 | |
| 1591 | 1689 | test "zig fmt: 2nd arg multiline string many args" { |
| 1690 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1691 | |
| 1592 | 1692 | try testCanonical( |
| 1593 | 1693 | \\comptime { |
| 1594 | 1694 | \\ cases.addAsm("hello world linux x86_64", |
| ... | ... | @@ -1600,6 +1700,8 @@ test "zig fmt: 2nd arg multiline string many args" { |
| 1600 | 1700 | } |
| 1601 | 1701 | |
| 1602 | 1702 | test "zig fmt: final arg multiline string" { |
| 1703 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1704 | |
| 1603 | 1705 | try testCanonical( |
| 1604 | 1706 | \\comptime { |
| 1605 | 1707 | \\ cases.addAsm("hello world linux x86_64", "Hello, world!\n", |
| ... | ... | @@ -1611,6 +1713,8 @@ test "zig fmt: final arg multiline string" { |
| 1611 | 1713 | } |
| 1612 | 1714 | |
| 1613 | 1715 | test "zig fmt: if condition wraps" { |
| 1716 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1717 | |
| 1614 | 1718 | try testTransform( |
| 1615 | 1719 | \\comptime { |
| 1616 | 1720 | \\ if (cond and |
| ... | ... | @@ -1692,6 +1796,8 @@ test "zig fmt: if condition wraps" { |
| 1692 | 1796 | } |
| 1693 | 1797 | |
| 1694 | 1798 | test "zig fmt: if condition has line break but must not wrap" { |
| 1799 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1800 | |
| 1695 | 1801 | try testCanonical( |
| 1696 | 1802 | \\comptime { |
| 1697 | 1803 | \\ if (self.user_input_options.put( |
| ... | ... | @@ -1716,6 +1822,8 @@ test "zig fmt: if condition has line break but must not wrap" { |
| 1716 | 1822 | } |
| 1717 | 1823 | |
| 1718 | 1824 | test "zig fmt: if condition has line break but must not wrap (no fn call comma)" { |
| 1825 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1826 | |
| 1719 | 1827 | try testCanonical( |
| 1720 | 1828 | \\comptime { |
| 1721 | 1829 | \\ if (self.user_input_options.put(name, UserInputOption{ |
| ... | ... | @@ -1737,6 +1845,8 @@ test "zig fmt: if condition has line break but must not wrap (no fn call comma)" |
| 1737 | 1845 | } |
| 1738 | 1846 | |
| 1739 | 1847 | test "zig fmt: function call with multiline argument" { |
| 1848 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1849 | |
| 1740 | 1850 | try testCanonical( |
| 1741 | 1851 | \\comptime { |
| 1742 | 1852 | \\ self.user_input_options.put(name, UserInputOption{ |
| ... | ... | @@ -1749,6 +1859,8 @@ test "zig fmt: function call with multiline argument" { |
| 1749 | 1859 | } |
| 1750 | 1860 | |
| 1751 | 1861 | test "zig fmt: if-else with comment before else" { |
| 1862 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1863 | |
| 1752 | 1864 | try testCanonical( |
| 1753 | 1865 | \\comptime { |
| 1754 | 1866 | \\ // cexp(finite|nan +- i inf|nan) = nan + i nan |
| ... | ... | @@ -1767,6 +1879,8 @@ test "zig fmt: if-else with comment before else" { |
| 1767 | 1879 | } |
| 1768 | 1880 | |
| 1769 | 1881 | test "zig fmt: if nested" { |
| 1882 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1883 | |
| 1770 | 1884 | try testCanonical( |
| 1771 | 1885 | \\pub fn foo() void { |
| 1772 | 1886 | \\ return if ((aInt & bInt) >= 0) |
| ... | ... | @@ -1790,6 +1904,8 @@ test "zig fmt: if nested" { |
| 1790 | 1904 | } |
| 1791 | 1905 | |
| 1792 | 1906 | test "zig fmt: respect line breaks in if-else" { |
| 1907 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1908 | |
| 1793 | 1909 | try testCanonical( |
| 1794 | 1910 | \\comptime { |
| 1795 | 1911 | \\ return if (cond) a else b; |
| ... | ... | @@ -1809,6 +1925,8 @@ test "zig fmt: respect line breaks in if-else" { |
| 1809 | 1925 | } |
| 1810 | 1926 | |
| 1811 | 1927 | test "zig fmt: respect line breaks after infix operators" { |
| 1928 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1929 | |
| 1812 | 1930 | try testCanonical( |
| 1813 | 1931 | \\comptime { |
| 1814 | 1932 | \\ self.crc = |
| ... | ... | @@ -1872,6 +1990,8 @@ test "zig fmt: switch comment after prong" { |
| 1872 | 1990 | } |
| 1873 | 1991 | |
| 1874 | 1992 | test "zig fmt: struct literal no trailing comma" { |
| 1993 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 1994 | |
| 1875 | 1995 | try testTransform( |
| 1876 | 1996 | \\const a = foo{ .x = 1, .y = 2 }; |
| 1877 | 1997 | \\const a = foo{ .x = 1, |
| ... | ... | @@ -1890,6 +2010,8 @@ test "zig fmt: struct literal no trailing comma" { |
| 1890 | 2010 | } |
| 1891 | 2011 | |
| 1892 | 2012 | test "zig fmt: struct literal containing a multiline expression" { |
| 2013 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2014 | |
| 1893 | 2015 | try testTransform( |
| 1894 | 2016 | \\const a = A{ .x = if (f1()) 10 else 20 }; |
| 1895 | 2017 | \\const a = A{ .x = if (f1()) 10 else 20, }; |
| ... | ... | @@ -1951,6 +2073,8 @@ test "zig fmt: struct literal containing a multiline expression" { |
| 1951 | 2073 | } |
| 1952 | 2074 | |
| 1953 | 2075 | test "zig fmt: array literal with hint" { |
| 2076 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2077 | |
| 1954 | 2078 | try testTransform( |
| 1955 | 2079 | \\const a = []u8{ |
| 1956 | 2080 | \\ 1, 2, // |
| ... | ... | @@ -2028,6 +2152,8 @@ test "zig fmt: array literal with hint" { |
| 2028 | 2152 | } |
| 2029 | 2153 | |
| 2030 | 2154 | test "zig fmt: array literal vertical column alignment" { |
| 2155 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2156 | |
| 2031 | 2157 | try testTransform( |
| 2032 | 2158 | \\const a = []u8{ |
| 2033 | 2159 | \\ 1000, 200, |
| ... | ... | @@ -2075,6 +2201,8 @@ test "zig fmt: array literal vertical column alignment" { |
| 2075 | 2201 | } |
| 2076 | 2202 | |
| 2077 | 2203 | test "zig fmt: multiline string with backslash at end of line" { |
| 2204 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2205 | |
| 2078 | 2206 | try testCanonical( |
| 2079 | 2207 | \\comptime { |
| 2080 | 2208 | \\ err( |
| ... | ... | @@ -2086,6 +2214,8 @@ test "zig fmt: multiline string with backslash at end of line" { |
| 2086 | 2214 | } |
| 2087 | 2215 | |
| 2088 | 2216 | test "zig fmt: multiline string parameter in fn call with trailing comma" { |
| 2217 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2218 | |
| 2089 | 2219 | try testCanonical( |
| 2090 | 2220 | \\fn foo() void { |
| 2091 | 2221 | \\ try stdout.print( |
| ... | ... | @@ -2104,6 +2234,8 @@ test "zig fmt: multiline string parameter in fn call with trailing comma" { |
| 2104 | 2234 | } |
| 2105 | 2235 | |
| 2106 | 2236 | test "zig fmt: trailing comma on fn call" { |
| 2237 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2238 | |
| 2107 | 2239 | try testCanonical( |
| 2108 | 2240 | \\comptime { |
| 2109 | 2241 | \\ var module = try Module.create( |
| ... | ... | @@ -2117,6 +2249,8 @@ test "zig fmt: trailing comma on fn call" { |
| 2117 | 2249 | } |
| 2118 | 2250 | |
| 2119 | 2251 | test "zig fmt: multi line arguments without last comma" { |
| 2252 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2253 | |
| 2120 | 2254 | try testTransform( |
| 2121 | 2255 | \\pub fn foo( |
| 2122 | 2256 | \\ a: usize, |
| ... | ... | @@ -2178,6 +2312,8 @@ test "zig fmt: extra newlines at the end" { |
| 2178 | 2312 | } |
| 2179 | 2313 | |
| 2180 | 2314 | test "zig fmt: simple asm" { |
| 2315 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2316 | |
| 2181 | 2317 | try testTransform( |
| 2182 | 2318 | \\comptime { |
| 2183 | 2319 | \\ asm volatile ( |
| ... | ... | @@ -2215,6 +2351,8 @@ test "zig fmt: simple asm" { |
| 2215 | 2351 | } |
| 2216 | 2352 | |
| 2217 | 2353 | test "zig fmt: nested struct literal with one item" { |
| 2354 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2355 | |
| 2218 | 2356 | try testCanonical( |
| 2219 | 2357 | \\const a = foo{ |
| 2220 | 2358 | \\ .item = bar{ .a = b }, |
| ... | ... | @@ -2258,6 +2396,8 @@ test "zig fmt: slice align" { |
| 2258 | 2396 | } |
| 2259 | 2397 | |
| 2260 | 2398 | test "zig fmt: add trailing comma to array literal" { |
| 2399 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2400 | |
| 2261 | 2401 | try testTransform( |
| 2262 | 2402 | \\comptime { |
| 2263 | 2403 | \\ return []u16{'m', 's', 'y', 's', '-' // hi |
| ... | ... | @@ -2299,6 +2439,8 @@ test "zig fmt: line comment after doc comment" { |
| 2299 | 2439 | } |
| 2300 | 2440 | |
| 2301 | 2441 | test "zig fmt: bit field alignment" { |
| 2442 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2443 | |
| 2302 | 2444 | try testCanonical( |
| 2303 | 2445 | \\test { |
| 2304 | 2446 | \\ assert(@TypeOf(&blah.b) == *align(1:3:6) const u3); |
| ... | ... | @@ -2330,6 +2472,8 @@ test "zig fmt: float literal with exponent" { |
| 2330 | 2472 | } |
| 2331 | 2473 | |
| 2332 | 2474 | test "zig fmt: if-else end of comptime" { |
| 2475 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2476 | |
| 2333 | 2477 | try testCanonical( |
| 2334 | 2478 | \\comptime { |
| 2335 | 2479 | \\ if (a) { |
| ... | ... | @@ -2343,6 +2487,8 @@ test "zig fmt: if-else end of comptime" { |
| 2343 | 2487 | } |
| 2344 | 2488 | |
| 2345 | 2489 | test "zig fmt: nested blocks" { |
| 2490 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2491 | |
| 2346 | 2492 | try testCanonical( |
| 2347 | 2493 | \\comptime { |
| 2348 | 2494 | \\ { |
| ... | ... | @@ -2358,6 +2504,8 @@ test "zig fmt: nested blocks" { |
| 2358 | 2504 | } |
| 2359 | 2505 | |
| 2360 | 2506 | test "zig fmt: block with same line comment after end brace" { |
| 2507 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2508 | |
| 2361 | 2509 | try testCanonical( |
| 2362 | 2510 | \\comptime { |
| 2363 | 2511 | \\ { |
| ... | ... | @@ -2369,6 +2517,8 @@ test "zig fmt: block with same line comment after end brace" { |
| 2369 | 2517 | } |
| 2370 | 2518 | |
| 2371 | 2519 | test "zig fmt: statements with comment between" { |
| 2520 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2521 | |
| 2372 | 2522 | try testCanonical( |
| 2373 | 2523 | \\comptime { |
| 2374 | 2524 | \\ a = b; |
| ... | ... | @@ -2380,6 +2530,8 @@ test "zig fmt: statements with comment between" { |
| 2380 | 2530 | } |
| 2381 | 2531 | |
| 2382 | 2532 | test "zig fmt: statements with empty line between" { |
| 2533 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2534 | |
| 2383 | 2535 | try testCanonical( |
| 2384 | 2536 | \\comptime { |
| 2385 | 2537 | \\ a = b; |
| ... | ... | @@ -2399,6 +2551,8 @@ test "zig fmt: ptr deref operator and unwrap optional operator" { |
| 2399 | 2551 | } |
| 2400 | 2552 | |
| 2401 | 2553 | test "zig fmt: comment after if before another if" { |
| 2554 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2555 | |
| 2402 | 2556 | try testCanonical( |
| 2403 | 2557 | \\test "aoeu" { |
| 2404 | 2558 | \\ // comment |
| ... | ... | @@ -2421,6 +2575,8 @@ test "zig fmt: comment after if before another if" { |
| 2421 | 2575 | } |
| 2422 | 2576 | |
| 2423 | 2577 | test "zig fmt: line comment between if block and else keyword" { |
| 2578 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2579 | |
| 2424 | 2580 | try testCanonical( |
| 2425 | 2581 | \\test "aoeu" { |
| 2426 | 2582 | \\ // cexp(finite|nan +- i inf|nan) = nan + i nan |
| ... | ... | @@ -2442,6 +2598,8 @@ test "zig fmt: line comment between if block and else keyword" { |
| 2442 | 2598 | } |
| 2443 | 2599 | |
| 2444 | 2600 | test "zig fmt: same line comments in expression" { |
| 2601 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2602 | |
| 2445 | 2603 | try testCanonical( |
| 2446 | 2604 | \\test "aoeu" { |
| 2447 | 2605 | \\ const x = ( // a |
| ... | ... | @@ -2482,6 +2640,8 @@ test "zig fmt: add comma on last switch prong" { |
| 2482 | 2640 | } |
| 2483 | 2641 | |
| 2484 | 2642 | test "zig fmt: same-line comment after a statement" { |
| 2643 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2644 | |
| 2485 | 2645 | try testCanonical( |
| 2486 | 2646 | \\test "" { |
| 2487 | 2647 | \\ a = b; |
| ... | ... | @@ -2527,6 +2687,8 @@ test "zig fmt: same-line comment after switch prong" { |
| 2527 | 2687 | } |
| 2528 | 2688 | |
| 2529 | 2689 | test "zig fmt: same-line comment after non-block if expression" { |
| 2690 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2691 | |
| 2530 | 2692 | try testCanonical( |
| 2531 | 2693 | \\comptime { |
| 2532 | 2694 | \\ if (sr > n_uword_bits - 1) // d > r |
| ... | ... | @@ -2537,6 +2699,8 @@ test "zig fmt: same-line comment after non-block if expression" { |
| 2537 | 2699 | } |
| 2538 | 2700 | |
| 2539 | 2701 | test "zig fmt: same-line comment on comptime expression" { |
| 2702 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2703 | |
| 2540 | 2704 | try testCanonical( |
| 2541 | 2705 | \\test "" { |
| 2542 | 2706 | \\ comptime assert(@typeInfo(T) == .Int); // must pass an integer to absInt |
| ... | ... | @@ -2546,6 +2710,8 @@ test "zig fmt: same-line comment on comptime expression" { |
| 2546 | 2710 | } |
| 2547 | 2711 | |
| 2548 | 2712 | test "zig fmt: switch with empty body" { |
| 2713 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2714 | |
| 2549 | 2715 | try testCanonical( |
| 2550 | 2716 | \\test "" { |
| 2551 | 2717 | \\ foo() catch |err| switch (err) {}; |
| ... | ... | @@ -2555,6 +2721,8 @@ test "zig fmt: switch with empty body" { |
| 2555 | 2721 | } |
| 2556 | 2722 | |
| 2557 | 2723 | test "zig fmt: line comments in struct initializer" { |
| 2724 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2725 | |
| 2558 | 2726 | try testCanonical( |
| 2559 | 2727 | \\fn foo() void { |
| 2560 | 2728 | \\ return Self{ |
| ... | ... | @@ -2577,6 +2745,8 @@ test "zig fmt: line comments in struct initializer" { |
| 2577 | 2745 | } |
| 2578 | 2746 | |
| 2579 | 2747 | test "zig fmt: first line comment in struct initializer" { |
| 2748 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2749 | |
| 2580 | 2750 | try testCanonical( |
| 2581 | 2751 | \\pub fn acquire(self: *Self) HeldLock { |
| 2582 | 2752 | \\ return HeldLock{ |
| ... | ... | @@ -2645,6 +2815,8 @@ test "zig fmt: union(enum(u32)) with assigned enum values" { |
| 2645 | 2815 | } |
| 2646 | 2816 | |
| 2647 | 2817 | test "zig fmt: resume from suspend block" { |
| 2818 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2819 | |
| 2648 | 2820 | try testCanonical( |
| 2649 | 2821 | \\fn foo() void { |
| 2650 | 2822 | \\ suspend { |
| ... | ... | @@ -2730,6 +2902,8 @@ test "zig fmt: comments before global variables" { |
| 2730 | 2902 | } |
| 2731 | 2903 | |
| 2732 | 2904 | test "zig fmt: comments in statements" { |
| 2905 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2906 | |
| 2733 | 2907 | try testCanonical( |
| 2734 | 2908 | \\test "std" { |
| 2735 | 2909 | \\ // statement comment |
| ... | ... | @@ -2757,6 +2931,8 @@ test "zig fmt: comments before test decl" { |
| 2757 | 2931 | } |
| 2758 | 2932 | |
| 2759 | 2933 | test "zig fmt: preserve spacing" { |
| 2934 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 2935 | |
| 2760 | 2936 | try testCanonical( |
| 2761 | 2937 | \\const std = @import("std"); |
| 2762 | 2938 | \\ |
| ... | ... | @@ -2825,6 +3001,8 @@ test "zig fmt: alignment" { |
| 2825 | 3001 | } |
| 2826 | 3002 | |
| 2827 | 3003 | test "zig fmt: C main" { |
| 3004 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3005 | |
| 2828 | 3006 | try testCanonical( |
| 2829 | 3007 | \\fn main(argc: c_int, argv: **u8) c_int { |
| 2830 | 3008 | \\ const a = b; |
| ... | ... | @@ -2834,6 +3012,8 @@ test "zig fmt: C main" { |
| 2834 | 3012 | } |
| 2835 | 3013 | |
| 2836 | 3014 | test "zig fmt: return" { |
| 3015 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3016 | |
| 2837 | 3017 | try testCanonical( |
| 2838 | 3018 | \\fn foo(argc: c_int, argv: **u8) c_int { |
| 2839 | 3019 | \\ return 0; |
| ... | ... | @@ -2896,6 +3076,8 @@ test "zig fmt: slice attributes" { |
| 2896 | 3076 | } |
| 2897 | 3077 | |
| 2898 | 3078 | test "zig fmt: test declaration" { |
| 3079 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3080 | |
| 2899 | 3081 | try testCanonical( |
| 2900 | 3082 | \\test "test name" { |
| 2901 | 3083 | \\ const a = 1; |
| ... | ... | @@ -2906,6 +3088,8 @@ test "zig fmt: test declaration" { |
| 2906 | 3088 | } |
| 2907 | 3089 | |
| 2908 | 3090 | test "zig fmt: infix operators" { |
| 3091 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3092 | |
| 2909 | 3093 | try testCanonical( |
| 2910 | 3094 | \\test { |
| 2911 | 3095 | \\ var i = undefined; |
| ... | ... | @@ -2958,6 +3142,8 @@ test "zig fmt: infix operators" { |
| 2958 | 3142 | } |
| 2959 | 3143 | |
| 2960 | 3144 | test "zig fmt: precedence" { |
| 3145 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3146 | |
| 2961 | 3147 | try testCanonical( |
| 2962 | 3148 | \\test "precedence" { |
| 2963 | 3149 | \\ a!b(); |
| ... | ... | @@ -2990,6 +3176,8 @@ test "zig fmt: precedence" { |
| 2990 | 3176 | } |
| 2991 | 3177 | |
| 2992 | 3178 | test "zig fmt: prefix operators" { |
| 3179 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3180 | |
| 2993 | 3181 | try testCanonical( |
| 2994 | 3182 | \\test "prefix operators" { |
| 2995 | 3183 | \\ try return --%~!&0; |
| ... | ... | @@ -2999,6 +3187,8 @@ test "zig fmt: prefix operators" { |
| 2999 | 3187 | } |
| 3000 | 3188 | |
| 3001 | 3189 | test "zig fmt: call expression" { |
| 3190 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3191 | |
| 3002 | 3192 | try testCanonical( |
| 3003 | 3193 | \\test "test calls" { |
| 3004 | 3194 | \\ a(); |
| ... | ... | @@ -3018,6 +3208,8 @@ test "zig fmt: anytype type" { |
| 3018 | 3208 | } |
| 3019 | 3209 | |
| 3020 | 3210 | test "zig fmt: functions" { |
| 3211 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3212 | |
| 3021 | 3213 | try testCanonical( |
| 3022 | 3214 | \\extern fn puts(s: *const u8) c_int; |
| 3023 | 3215 | \\extern "c" fn puts(s: *const u8) c_int; |
| ... | ... | @@ -3042,6 +3234,8 @@ test "zig fmt: functions" { |
| 3042 | 3234 | } |
| 3043 | 3235 | |
| 3044 | 3236 | test "zig fmt: multiline string" { |
| 3237 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3238 | |
| 3045 | 3239 | try testCanonical( |
| 3046 | 3240 | \\test "" { |
| 3047 | 3241 | \\ const s1 = |
| ... | ... | @@ -3060,6 +3254,8 @@ test "zig fmt: multiline string" { |
| 3060 | 3254 | } |
| 3061 | 3255 | |
| 3062 | 3256 | test "zig fmt: values" { |
| 3257 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3258 | |
| 3063 | 3259 | try testCanonical( |
| 3064 | 3260 | \\test "values" { |
| 3065 | 3261 | \\ 1; |
| ... | ... | @@ -3079,6 +3275,8 @@ test "zig fmt: values" { |
| 3079 | 3275 | } |
| 3080 | 3276 | |
| 3081 | 3277 | test "zig fmt: indexing" { |
| 3278 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3279 | |
| 3082 | 3280 | try testCanonical( |
| 3083 | 3281 | \\test "test index" { |
| 3084 | 3282 | \\ a[0]; |
| ... | ... | @@ -3099,6 +3297,8 @@ test "zig fmt: indexing" { |
| 3099 | 3297 | } |
| 3100 | 3298 | |
| 3101 | 3299 | test "zig fmt: struct declaration" { |
| 3300 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3301 | |
| 3102 | 3302 | try testCanonical( |
| 3103 | 3303 | \\const S = struct { |
| 3104 | 3304 | \\ const Self = @This(); |
| ... | ... | @@ -3205,6 +3405,8 @@ test "zig fmt: union declaration" { |
| 3205 | 3405 | } |
| 3206 | 3406 | |
| 3207 | 3407 | test "zig fmt: arrays" { |
| 3408 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3409 | |
| 3208 | 3410 | try testCanonical( |
| 3209 | 3411 | \\test "test array" { |
| 3210 | 3412 | \\ const a: [2]u8 = [2]u8{ |
| ... | ... | @@ -3223,6 +3425,8 @@ test "zig fmt: arrays" { |
| 3223 | 3425 | } |
| 3224 | 3426 | |
| 3225 | 3427 | test "zig fmt: container initializers" { |
| 3428 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3429 | |
| 3226 | 3430 | try testCanonical( |
| 3227 | 3431 | \\const a0 = []u8{}; |
| 3228 | 3432 | \\const a1 = []u8{1}; |
| ... | ... | @@ -3243,6 +3447,8 @@ test "zig fmt: container initializers" { |
| 3243 | 3447 | } |
| 3244 | 3448 | |
| 3245 | 3449 | test "zig fmt: catch" { |
| 3450 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3451 | |
| 3246 | 3452 | try testCanonical( |
| 3247 | 3453 | \\test "catch" { |
| 3248 | 3454 | \\ const a: anyerror!u8 = 0; |
| ... | ... | @@ -3258,6 +3464,8 @@ test "zig fmt: catch" { |
| 3258 | 3464 | } |
| 3259 | 3465 | |
| 3260 | 3466 | test "zig fmt: blocks" { |
| 3467 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3468 | |
| 3261 | 3469 | try testCanonical( |
| 3262 | 3470 | \\test "blocks" { |
| 3263 | 3471 | \\ { |
| ... | ... | @@ -3280,6 +3488,8 @@ test "zig fmt: blocks" { |
| 3280 | 3488 | } |
| 3281 | 3489 | |
| 3282 | 3490 | test "zig fmt: switch" { |
| 3491 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3492 | |
| 3283 | 3493 | try testCanonical( |
| 3284 | 3494 | \\test "switch" { |
| 3285 | 3495 | \\ switch (0) { |
| ... | ... | @@ -3335,6 +3545,8 @@ test "zig fmt: switch" { |
| 3335 | 3545 | } |
| 3336 | 3546 | |
| 3337 | 3547 | test "zig fmt: switch multiline string" { |
| 3548 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3549 | |
| 3338 | 3550 | try testCanonical( |
| 3339 | 3551 | \\test "switch multiline string" { |
| 3340 | 3552 | \\ const x: u32 = 0; |
| ... | ... | @@ -3366,6 +3578,8 @@ test "zig fmt: switch multiline string" { |
| 3366 | 3578 | } |
| 3367 | 3579 | |
| 3368 | 3580 | test "zig fmt: while" { |
| 3581 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3582 | |
| 3369 | 3583 | try testCanonical( |
| 3370 | 3584 | \\test "while" { |
| 3371 | 3585 | \\ while (10 < 1) unreachable; |
| ... | ... | @@ -3441,6 +3655,8 @@ test "zig fmt: while" { |
| 3441 | 3655 | } |
| 3442 | 3656 | |
| 3443 | 3657 | test "zig fmt: for" { |
| 3658 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3659 | |
| 3444 | 3660 | try testCanonical( |
| 3445 | 3661 | \\test "for" { |
| 3446 | 3662 | \\ for (a) |v| { |
| ... | ... | @@ -3542,6 +3758,8 @@ test "zig fmt: for" { |
| 3542 | 3758 | } |
| 3543 | 3759 | |
| 3544 | 3760 | test "zig fmt: for if" { |
| 3761 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3762 | |
| 3545 | 3763 | try testCanonical( |
| 3546 | 3764 | \\test { |
| 3547 | 3765 | \\ for (a) |x| if (x) f(x); |
| ... | ... | @@ -3567,6 +3785,8 @@ test "zig fmt: for if" { |
| 3567 | 3785 | } |
| 3568 | 3786 | |
| 3569 | 3787 | test "zig fmt: if for" { |
| 3788 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3789 | |
| 3570 | 3790 | try testCanonical( |
| 3571 | 3791 | \\test { |
| 3572 | 3792 | \\ if (a) for (x) |x| f(x); |
| ... | ... | @@ -3592,6 +3812,8 @@ test "zig fmt: if for" { |
| 3592 | 3812 | } |
| 3593 | 3813 | |
| 3594 | 3814 | test "zig fmt: while if" { |
| 3815 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3816 | |
| 3595 | 3817 | try testCanonical( |
| 3596 | 3818 | \\test { |
| 3597 | 3819 | \\ while (a) if (x) f(x); |
| ... | ... | @@ -3617,6 +3839,8 @@ test "zig fmt: while if" { |
| 3617 | 3839 | } |
| 3618 | 3840 | |
| 3619 | 3841 | test "zig fmt: if while" { |
| 3842 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3843 | |
| 3620 | 3844 | try testCanonical( |
| 3621 | 3845 | \\test { |
| 3622 | 3846 | \\ if (a) while (x) : (cont) f(x); |
| ... | ... | @@ -3642,6 +3866,8 @@ test "zig fmt: if while" { |
| 3642 | 3866 | } |
| 3643 | 3867 | |
| 3644 | 3868 | test "zig fmt: while for" { |
| 3869 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3870 | |
| 3645 | 3871 | try testCanonical( |
| 3646 | 3872 | \\test { |
| 3647 | 3873 | \\ while (a) for (x) |x| f(x); |
| ... | ... | @@ -3667,6 +3893,8 @@ test "zig fmt: while for" { |
| 3667 | 3893 | } |
| 3668 | 3894 | |
| 3669 | 3895 | test "zig fmt: for while" { |
| 3896 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3897 | |
| 3670 | 3898 | try testCanonical( |
| 3671 | 3899 | \\test { |
| 3672 | 3900 | \\ for (a) |a| while (x) |x| f(x); |
| ... | ... | @@ -3692,6 +3920,8 @@ test "zig fmt: for while" { |
| 3692 | 3920 | } |
| 3693 | 3921 | |
| 3694 | 3922 | test "zig fmt: if" { |
| 3923 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3924 | |
| 3695 | 3925 | try testCanonical( |
| 3696 | 3926 | \\test "if" { |
| 3697 | 3927 | \\ if (10 < 0) { |
| ... | ... | @@ -3741,6 +3971,8 @@ test "zig fmt: if" { |
| 3741 | 3971 | } |
| 3742 | 3972 | |
| 3743 | 3973 | test "zig fmt: fix single statement if/for/while line breaks" { |
| 3974 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 3975 | |
| 3744 | 3976 | try testTransform( |
| 3745 | 3977 | \\test { |
| 3746 | 3978 | \\ if (cond) a |
| ... | ... | @@ -3793,6 +4025,8 @@ test "zig fmt: fix single statement if/for/while line breaks" { |
| 3793 | 4025 | } |
| 3794 | 4026 | |
| 3795 | 4027 | test "zig fmt: anon struct/array literal in if" { |
| 4028 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4029 | |
| 3796 | 4030 | try testCanonical( |
| 3797 | 4031 | \\test { |
| 3798 | 4032 | \\ const a = if (cond) .{ |
| ... | ... | @@ -3817,6 +4051,8 @@ test "zig fmt: anon struct/array literal in if" { |
| 3817 | 4051 | } |
| 3818 | 4052 | |
| 3819 | 4053 | test "zig fmt: defer" { |
| 4054 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4055 | |
| 3820 | 4056 | try testCanonical( |
| 3821 | 4057 | \\test "defer" { |
| 3822 | 4058 | \\ var i: usize = 0; |
| ... | ... | @@ -3837,6 +4073,8 @@ test "zig fmt: defer" { |
| 3837 | 4073 | } |
| 3838 | 4074 | |
| 3839 | 4075 | test "zig fmt: comptime" { |
| 4076 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4077 | |
| 3840 | 4078 | try testCanonical( |
| 3841 | 4079 | \\fn a() u8 { |
| 3842 | 4080 | \\ return 5; |
| ... | ... | @@ -3876,6 +4114,8 @@ test "zig fmt: comptime" { |
| 3876 | 4114 | } |
| 3877 | 4115 | |
| 3878 | 4116 | test "zig fmt: fn type" { |
| 4117 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4118 | |
| 3879 | 4119 | try testCanonical( |
| 3880 | 4120 | \\fn a(i: u8) u8 { |
| 3881 | 4121 | \\ return i + 1; |
| ... | ... | @@ -3889,6 +4129,8 @@ test "zig fmt: fn type" { |
| 3889 | 4129 | } |
| 3890 | 4130 | |
| 3891 | 4131 | test "zig fmt: inline asm" { |
| 4132 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4133 | |
| 3892 | 4134 | try testCanonical( |
| 3893 | 4135 | \\pub fn syscall1(number: usize, arg1: usize) usize { |
| 3894 | 4136 | \\ return asm volatile ("syscall" |
| ... | ... | @@ -3903,6 +4145,8 @@ test "zig fmt: inline asm" { |
| 3903 | 4145 | } |
| 3904 | 4146 | |
| 3905 | 4147 | test "zig fmt: async functions" { |
| 4148 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4149 | |
| 3906 | 4150 | try testCanonical( |
| 3907 | 4151 | \\fn simpleAsyncFn() void { |
| 3908 | 4152 | \\ const a = async a.b(); |
| ... | ... | @@ -3931,6 +4175,8 @@ test "zig fmt: nosuspend" { |
| 3931 | 4175 | } |
| 3932 | 4176 | |
| 3933 | 4177 | test "zig fmt: Block after if" { |
| 4178 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4179 | |
| 3934 | 4180 | try testCanonical( |
| 3935 | 4181 | \\test { |
| 3936 | 4182 | \\ if (true) { |
| ... | ... | @@ -3962,6 +4208,8 @@ test "zig fmt: string identifier" { |
| 3962 | 4208 | } |
| 3963 | 4209 | |
| 3964 | 4210 | test "zig fmt: error return" { |
| 4211 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4212 | |
| 3965 | 4213 | try testCanonical( |
| 3966 | 4214 | \\fn err() anyerror { |
| 3967 | 4215 | \\ call(); |
| ... | ... | @@ -3972,6 +4220,8 @@ test "zig fmt: error return" { |
| 3972 | 4220 | } |
| 3973 | 4221 | |
| 3974 | 4222 | test "zig fmt: comptime block in container" { |
| 4223 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4224 | |
| 3975 | 4225 | try testCanonical( |
| 3976 | 4226 | \\pub fn container() type { |
| 3977 | 4227 | \\ return struct { |
| ... | ... | @@ -3987,6 +4237,8 @@ test "zig fmt: comptime block in container" { |
| 3987 | 4237 | } |
| 3988 | 4238 | |
| 3989 | 4239 | test "zig fmt: inline asm parameter alignment" { |
| 4240 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4241 | |
| 3990 | 4242 | try testCanonical( |
| 3991 | 4243 | \\pub fn main() void { |
| 3992 | 4244 | \\ asm volatile ( |
| ... | ... | @@ -4025,6 +4277,8 @@ test "zig fmt: inline asm parameter alignment" { |
| 4025 | 4277 | } |
| 4026 | 4278 | |
| 4027 | 4279 | test "zig fmt: multiline string in array" { |
| 4280 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4281 | |
| 4028 | 4282 | try testCanonical( |
| 4029 | 4283 | \\const Foo = [][]const u8{ |
| 4030 | 4284 | \\ \\aaa |
| ... | ... | @@ -4050,6 +4304,8 @@ test "zig fmt: multiline string in array" { |
| 4050 | 4304 | } |
| 4051 | 4305 | |
| 4052 | 4306 | test "zig fmt: if type expr" { |
| 4307 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4308 | |
| 4053 | 4309 | try testCanonical( |
| 4054 | 4310 | \\const mycond = true; |
| 4055 | 4311 | \\pub fn foo() if (mycond) i32 else void { |
| ... | ... | @@ -4078,6 +4334,8 @@ test "zig fmt: comment after empty comment" { |
| 4078 | 4334 | } |
| 4079 | 4335 | |
| 4080 | 4336 | test "zig fmt: line comment in array" { |
| 4337 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4338 | |
| 4081 | 4339 | try testTransform( |
| 4082 | 4340 | \\test "a" { |
| 4083 | 4341 | \\ var arr = [_]u32{ |
| ... | ... | @@ -4136,6 +4394,8 @@ test "zig fmt: comment after params" { |
| 4136 | 4394 | } |
| 4137 | 4395 | |
| 4138 | 4396 | test "zig fmt: comment in array initializer/access" { |
| 4397 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4398 | |
| 4139 | 4399 | try testCanonical( |
| 4140 | 4400 | \\test "a" { |
| 4141 | 4401 | \\ var a = x{ //aa |
| ... | ... | @@ -4172,6 +4432,8 @@ test "zig fmt: comment in array initializer/access" { |
| 4172 | 4432 | } |
| 4173 | 4433 | |
| 4174 | 4434 | test "zig fmt: comments at several places in struct init" { |
| 4435 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4436 | |
| 4175 | 4437 | try testTransform( |
| 4176 | 4438 | \\var bar = Bar{ |
| 4177 | 4439 | \\ .x = 10, // test |
| ... | ... | @@ -4395,6 +4657,8 @@ test "zig fmt: integer literals with underscore separators" { |
| 4395 | 4657 | } |
| 4396 | 4658 | |
| 4397 | 4659 | test "zig fmt: hex literals with underscore separators" { |
| 4660 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4661 | |
| 4398 | 4662 | try testTransform( |
| 4399 | 4663 | \\pub fn orMask(a: [ 1_000 ]u64, b: [ 1_000] u64) [1_000]u64 { |
| 4400 | 4664 | \\ var c: [1_000]u64 = [1]u64{ 0xFFFF_FFFF_FFFF_FFFF}**1_000; |
| ... | ... | @@ -4418,6 +4682,8 @@ test "zig fmt: hex literals with underscore separators" { |
| 4418 | 4682 | } |
| 4419 | 4683 | |
| 4420 | 4684 | test "zig fmt: decimal float literals with underscore separators" { |
| 4685 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4686 | |
| 4421 | 4687 | try testTransform( |
| 4422 | 4688 | \\pub fn main() void { |
| 4423 | 4689 | \\ const a:f64=(10.0e-0+(10.0e+0))+10_00.00_00e-2+20_00.00_10e+4; |
| ... | ... | @@ -4435,6 +4701,8 @@ test "zig fmt: decimal float literals with underscore separators" { |
| 4435 | 4701 | } |
| 4436 | 4702 | |
| 4437 | 4703 | test "zig fmt: hexadeciaml float literals with underscore separators" { |
| 4704 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4705 | |
| 4438 | 4706 | try testTransform( |
| 4439 | 4707 | \\pub fn main() void { |
| 4440 | 4708 | \\ const a: f64 = (0x10.0p-0+(0x10.0p+0))+0x10_00.00_00p-8+0x00_00.00_10p+16; |
| ... | ... | @@ -4459,6 +4727,8 @@ test "zig fmt: C var args" { |
| 4459 | 4727 | } |
| 4460 | 4728 | |
| 4461 | 4729 | test "zig fmt: Only indent multiline string literals in function calls" { |
| 4730 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4731 | |
| 4462 | 4732 | try testCanonical( |
| 4463 | 4733 | \\test "zig fmt:" { |
| 4464 | 4734 | \\ try testTransform( |
| ... | ... | @@ -4476,6 +4746,8 @@ test "zig fmt: Only indent multiline string literals in function calls" { |
| 4476 | 4746 | } |
| 4477 | 4747 | |
| 4478 | 4748 | test "zig fmt: Don't add extra newline after if" { |
| 4749 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4750 | |
| 4479 | 4751 | try testCanonical( |
| 4480 | 4752 | \\pub fn atomicSymLink(allocator: Allocator, existing_path: []const u8, new_path: []const u8) !void { |
| 4481 | 4753 | \\ if (cwd().symLink(existing_path, new_path, .{})) { |
| ... | ... | @@ -4487,6 +4759,8 @@ test "zig fmt: Don't add extra newline after if" { |
| 4487 | 4759 | } |
| 4488 | 4760 | |
| 4489 | 4761 | test "zig fmt: comments in ternary ifs" { |
| 4762 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4763 | |
| 4490 | 4764 | try testCanonical( |
| 4491 | 4765 | \\const x = if (true) { |
| 4492 | 4766 | \\ 1; |
| ... | ... | @@ -4506,6 +4780,8 @@ test "zig fmt: comments in ternary ifs" { |
| 4506 | 4780 | } |
| 4507 | 4781 | |
| 4508 | 4782 | test "zig fmt: while statement in blockless if" { |
| 4783 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4784 | |
| 4509 | 4785 | try testCanonical( |
| 4510 | 4786 | \\pub fn main() void { |
| 4511 | 4787 | \\ const zoom_node = if (focused_node == layout_first) |
| ... | ... | @@ -4555,6 +4831,8 @@ test "zig fmt: test comments in field access chain" { |
| 4555 | 4831 | } |
| 4556 | 4832 | |
| 4557 | 4833 | test "zig fmt: allow line break before field access" { |
| 4834 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4835 | |
| 4558 | 4836 | try testCanonical( |
| 4559 | 4837 | \\test { |
| 4560 | 4838 | \\ const w = foo.bar().zippy(zag).iguessthisisok(); |
| ... | ... | @@ -4603,6 +4881,8 @@ test "zig fmt: allow line break before field access" { |
| 4603 | 4881 | } |
| 4604 | 4882 | |
| 4605 | 4883 | test "zig fmt: Indent comma correctly after multiline string literals in arg list (trailing comma)" { |
| 4884 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4885 | |
| 4606 | 4886 | try testCanonical( |
| 4607 | 4887 | \\fn foo() void { |
| 4608 | 4888 | \\ z.display_message_dialog( |
| ... | ... | @@ -4628,6 +4908,8 @@ test "zig fmt: Indent comma correctly after multiline string literals in arg lis |
| 4628 | 4908 | } |
| 4629 | 4909 | |
| 4630 | 4910 | test "zig fmt: Control flow statement as body of blockless if" { |
| 4911 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4912 | |
| 4631 | 4913 | try testCanonical( |
| 4632 | 4914 | \\pub fn main() void { |
| 4633 | 4915 | \\ const zoom_node = if (focused_node == layout_first) |
| ... | ... | @@ -4663,6 +4945,8 @@ test "zig fmt: Control flow statement as body of blockless if" { |
| 4663 | 4945 | } |
| 4664 | 4946 | |
| 4665 | 4947 | test "zig fmt: regression test for #5722" { |
| 4948 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4949 | |
| 4666 | 4950 | try testCanonical( |
| 4667 | 4951 | \\pub fn sendViewTags(self: Self) void { |
| 4668 | 4952 | \\ var it = ViewStack(View).iterator(self.output.views.first, std.math.maxInt(u32)); |
| ... | ... | @@ -4685,6 +4969,8 @@ test "zig fmt: regression test for #8974" { |
| 4685 | 4969 | } |
| 4686 | 4970 | |
| 4687 | 4971 | test "zig fmt: allow trailing line comments to do manual array formatting" { |
| 4972 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 4973 | |
| 4688 | 4974 | try testCanonical( |
| 4689 | 4975 | \\fn foo() void { |
| 4690 | 4976 | \\ self.code.appendSliceAssumeCapacity(&[_]u8{ |
| ... | ... | @@ -4723,6 +5009,8 @@ test "zig fmt: allow trailing line comments to do manual array formatting" { |
| 4723 | 5009 | } |
| 4724 | 5010 | |
| 4725 | 5011 | test "zig fmt: multiline string literals should play nice with array initializers" { |
| 5012 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5013 | |
| 4726 | 5014 | try testCanonical( |
| 4727 | 5015 | \\fn main() void { |
| 4728 | 5016 | \\ var a = .{.{.{.{.{.{.{.{ |
| ... | ... | @@ -4789,6 +5077,8 @@ test "zig fmt: multiline string literals should play nice with array initializer |
| 4789 | 5077 | } |
| 4790 | 5078 | |
| 4791 | 5079 | test "zig fmt: use of comments and multiline string literals may force the parameters over multiple lines" { |
| 5080 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5081 | |
| 4792 | 5082 | try testCanonical( |
| 4793 | 5083 | \\pub fn makeMemUndefined(qzz: []u8) i1 { |
| 4794 | 5084 | \\ cases.add( // fixed bug foo |
| ... | ... | @@ -4829,6 +5119,8 @@ test "zig fmt: use of comments and multiline string literals may force the param |
| 4829 | 5119 | } |
| 4830 | 5120 | |
| 4831 | 5121 | test "zig fmt: single argument trailing commas in @builtins()" { |
| 5122 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5123 | |
| 4832 | 5124 | try testCanonical( |
| 4833 | 5125 | \\pub fn foo(qzz: []u8) i1 { |
| 4834 | 5126 | \\ @panic( |
| ... | ... | @@ -4862,6 +5154,8 @@ test "zig fmt: trailing comma should force multiline 1 column" { |
| 4862 | 5154 | } |
| 4863 | 5155 | |
| 4864 | 5156 | test "zig fmt: function params should align nicely" { |
| 5157 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5158 | |
| 4865 | 5159 | try testCanonical( |
| 4866 | 5160 | \\pub fn foo() void { |
| 4867 | 5161 | \\ cases.addRuntimeSafety("slicing operator with sentinel", |
| ... | ... | @@ -4918,6 +5212,8 @@ test "zig fmt: remove trailing whitespace after doc comment" { |
| 4918 | 5212 | } |
| 4919 | 5213 | |
| 4920 | 5214 | test "zig fmt: for loop with ptr payload and index" { |
| 5215 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5216 | |
| 4921 | 5217 | try testCanonical( |
| 4922 | 5218 | \\test { |
| 4923 | 5219 | \\ for (self.entries.items, 0..) |*item, i| {} |
| ... | ... | @@ -4930,6 +5226,8 @@ test "zig fmt: for loop with ptr payload and index" { |
| 4930 | 5226 | } |
| 4931 | 5227 | |
| 4932 | 5228 | test "zig fmt: proper indent line comment after multi-line single expr while loop" { |
| 5229 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5230 | |
| 4933 | 5231 | try testCanonical( |
| 4934 | 5232 | \\test { |
| 4935 | 5233 | \\ while (a) : (b) |
| ... | ... | @@ -4943,6 +5241,8 @@ test "zig fmt: proper indent line comment after multi-line single expr while loo |
| 4943 | 5241 | } |
| 4944 | 5242 | |
| 4945 | 5243 | test "zig fmt: function with labeled block as return type" { |
| 5244 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5245 | |
| 4946 | 5246 | try testCanonical( |
| 4947 | 5247 | \\fn foo() t: { |
| 4948 | 5248 | \\ break :t bar; |
| ... | ... | @@ -4965,6 +5265,8 @@ test "zig fmt: extern function with missing param name" { |
| 4965 | 5265 | } |
| 4966 | 5266 | |
| 4967 | 5267 | test "zig fmt: line comment after multiline single expr if statement with multiline string" { |
| 5268 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5269 | |
| 4968 | 5270 | try testCanonical( |
| 4969 | 5271 | \\test { |
| 4970 | 5272 | \\ if (foo) |
| ... | ... | @@ -4997,6 +5299,8 @@ test "zig fmt: line comment after multiline single expr if statement with multil |
| 4997 | 5299 | } |
| 4998 | 5300 | |
| 4999 | 5301 | test "zig fmt: respect extra newline between fn and pub usingnamespace" { |
| 5302 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5303 | |
| 5000 | 5304 | try testCanonical( |
| 5001 | 5305 | \\fn foo() void { |
| 5002 | 5306 | \\ bar(); |
| ... | ... | @@ -5121,6 +5425,8 @@ test "zig fmt: insert trailing comma if comments in array init" { |
| 5121 | 5425 | } |
| 5122 | 5426 | |
| 5123 | 5427 | test "zig fmt: make single-line if no trailing comma" { |
| 5428 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5429 | |
| 5124 | 5430 | try testTransform( |
| 5125 | 5431 | \\test "function call no trailing comma" { |
| 5126 | 5432 | \\ foo( |
| ... | ... | @@ -5300,6 +5606,8 @@ test "zig fmt: missing const/var before local variable" { |
| 5300 | 5606 | } |
| 5301 | 5607 | |
| 5302 | 5608 | test "zig fmt: while continue expr" { |
| 5609 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5610 | |
| 5303 | 5611 | try testCanonical( |
| 5304 | 5612 | \\test { |
| 5305 | 5613 | \\ while (i > 0) |
| ... | ... | @@ -5319,6 +5627,8 @@ test "zig fmt: while continue expr" { |
| 5319 | 5627 | } |
| 5320 | 5628 | |
| 5321 | 5629 | test "zig fmt: canonicalize symbols (simple)" { |
| 5630 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5631 | |
| 5322 | 5632 | try testTransform( |
| 5323 | 5633 | \\const val_normal: Normal = .{}; |
| 5324 | 5634 | \\const @"val_unesc_me": @"UnescMe" = .{}; |
| ... | ... | @@ -5468,6 +5778,8 @@ test "zig fmt: canonicalize symbols (simple)" { |
| 5468 | 5778 | |
| 5469 | 5779 | // Contextually unescape when shadowing primitive types and values. |
| 5470 | 5780 | test "zig fmt: canonicalize symbols (primitive types)" { |
| 5781 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5782 | |
| 5471 | 5783 | try testTransform( |
| 5472 | 5784 | \\const @"anyopaque" = struct { |
| 5473 | 5785 | \\ @"u8": @"type" = true, |
| ... | ... | @@ -5577,6 +5889,8 @@ test "zig fmt: canonicalize symbols (primitive types)" { |
| 5577 | 5889 | |
| 5578 | 5890 | // Never unescape names spelled like keywords. |
| 5579 | 5891 | test "zig fmt: canonicalize symbols (keywords)" { |
| 5892 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5893 | |
| 5580 | 5894 | try testCanonical( |
| 5581 | 5895 | \\const @"enum" = struct { |
| 5582 | 5896 | \\ @"error": @"struct" = true, |
| ... | ... | @@ -5604,6 +5918,8 @@ test "zig fmt: canonicalize symbols (keywords)" { |
| 5604 | 5918 | } |
| 5605 | 5919 | |
| 5606 | 5920 | test "zig fmt: no space before newline before multiline string" { |
| 5921 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5922 | |
| 5607 | 5923 | try testCanonical( |
| 5608 | 5924 | \\const S = struct { |
| 5609 | 5925 | \\ text: []const u8, |
| ... | ... | @@ -5634,6 +5950,8 @@ test "zig fmt: no space before newline before multiline string" { |
| 5634 | 5950 | |
| 5635 | 5951 | // Normalize \xNN and \u{NN} escapes and unicode inside @"" escapes. |
| 5636 | 5952 | test "zig fmt: canonicalize symbols (character escapes)" { |
| 5953 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5954 | |
| 5637 | 5955 | try testTransform( |
| 5638 | 5956 | \\const @"\x46\x6f\x6f\x64" = struct { |
| 5639 | 5957 | \\ @"\x62\x61\x72\x6E": @"\x43\x72\x61\x62" = false, |
| ... | ... | @@ -5676,6 +5994,8 @@ test "zig fmt: canonicalize symbols (character escapes)" { |
| 5676 | 5994 | } |
| 5677 | 5995 | |
| 5678 | 5996 | test "zig fmt: canonicalize symbols (asm)" { |
| 5997 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 5998 | |
| 5679 | 5999 | try testTransform( |
| 5680 | 6000 | \\test "asm" { |
| 5681 | 6001 | \\ const @"null" = usize; |