| ... | ... | @@ -20,7 +20,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 20 | 20 | \\pub fn main() void { |
| 21 | 21 | \\ privateFunction(); |
| 22 | 22 | \\ const stdout = &getStdOut().outStream().stream; |
| 23 | | \\ stdout.print("OK 2\n") catch unreachable; |
| 23 | \\ stdout.print("OK 2\n", .{}) catch unreachable; |
| 24 | 24 | \\} |
| 25 | 25 | \\ |
| 26 | 26 | \\fn privateFunction() void { |
| ... | ... | @@ -35,7 +35,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 35 | 35 | \\// but it's private so it should be OK |
| 36 | 36 | \\fn privateFunction() void { |
| 37 | 37 | \\ const stdout = &getStdOut().outStream().stream; |
| 38 | | \\ stdout.print("OK 1\n") catch unreachable; |
| 38 | \\ stdout.print("OK 1\n", .{}) catch unreachable; |
| 39 | 39 | \\} |
| 40 | 40 | \\ |
| 41 | 41 | \\pub fn printText() void { |
| ... | ... | @@ -61,7 +61,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 61 | 61 | \\usingnamespace @import("std").io; |
| 62 | 62 | \\pub fn foo_function() void { |
| 63 | 63 | \\ const stdout = &getStdOut().outStream().stream; |
| 64 | | \\ stdout.print("OK\n") catch unreachable; |
| 64 | \\ stdout.print("OK\n", .{}) catch unreachable; |
| 65 | 65 | \\} |
| 66 | 66 | ); |
| 67 | 67 | |
| ... | ... | @@ -72,7 +72,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 72 | 72 | \\pub fn bar_function() void { |
| 73 | 73 | \\ if (foo_function()) { |
| 74 | 74 | \\ const stdout = &getStdOut().outStream().stream; |
| 75 | | \\ stdout.print("OK\n") catch unreachable; |
| 75 | \\ stdout.print("OK\n", .{}) catch unreachable; |
| 76 | 76 | \\ } |
| 77 | 77 | \\} |
| 78 | 78 | ); |
| ... | ... | @@ -104,7 +104,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 104 | 104 | \\ |
| 105 | 105 | \\pub fn ok() void { |
| 106 | 106 | \\ const stdout = &io.getStdOut().outStream().stream; |
| 107 | | \\ stdout.print(b_text) catch unreachable; |
| 107 | \\ stdout.print(b_text, .{}) catch unreachable; |
| 108 | 108 | \\} |
| 109 | 109 | ); |
| 110 | 110 | |
| ... | ... | @@ -122,7 +122,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 122 | 122 | \\ |
| 123 | 123 | \\pub fn main() void { |
| 124 | 124 | \\ const stdout = &io.getStdOut().outStream().stream; |
| 125 | | \\ stdout.print("Hello, world!\n{d:4} {x:3} {c}\n", @as(u32, 12), @as(u16, 0x12), @as(u8, 'a')) catch unreachable; |
| 125 | \\ stdout.print("Hello, world!\n{d:4} {x:3} {c}\n", .{@as(u32, 12), @as(u16, 0x12), @as(u8, 'a')}) catch unreachable; |
| 126 | 126 | \\} |
| 127 | 127 | , "Hello, world!\n 12 12 a\n"); |
| 128 | 128 | |
| ... | ... | @@ -265,7 +265,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 265 | 265 | \\} |
| 266 | 266 | \\fn print_ok(val: @typeOf(x)) @typeOf(foo) { |
| 267 | 267 | \\ const stdout = &io.getStdOut().outStream().stream; |
| 268 | | \\ stdout.print("OK\n") catch unreachable; |
| 268 | \\ stdout.print("OK\n", .{}) catch unreachable; |
| 269 | 269 | \\ return 0; |
| 270 | 270 | \\} |
| 271 | 271 | \\const foo : i32 = 0; |
| ... | ... | @@ -348,12 +348,12 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 348 | 348 | \\ const foo = Foo {.field1 = bar,}; |
| 349 | 349 | \\ const stdout = &io.getStdOut().outStream().stream; |
| 350 | 350 | \\ if (!foo.method()) { |
| 351 | | \\ stdout.print("BAD\n") catch unreachable; |
| 351 | \\ stdout.print("BAD\n", .{}) catch unreachable; |
| 352 | 352 | \\ } |
| 353 | 353 | \\ if (!bar.method()) { |
| 354 | | \\ stdout.print("BAD\n") catch unreachable; |
| 354 | \\ stdout.print("BAD\n", .{}) catch unreachable; |
| 355 | 355 | \\ } |
| 356 | | \\ stdout.print("OK\n") catch unreachable; |
| 356 | \\ stdout.print("OK\n", .{}) catch unreachable; |
| 357 | 357 | \\} |
| 358 | 358 | , "OK\n"); |
| 359 | 359 | |
| ... | ... | @@ -361,11 +361,11 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 361 | 361 | \\const io = @import("std").io; |
| 362 | 362 | \\pub fn main() void { |
| 363 | 363 | \\ const stdout = &io.getStdOut().outStream().stream; |
| 364 | | \\ stdout.print("before\n") catch unreachable; |
| 365 | | \\ defer stdout.print("defer1\n") catch unreachable; |
| 366 | | \\ defer stdout.print("defer2\n") catch unreachable; |
| 367 | | \\ defer stdout.print("defer3\n") catch unreachable; |
| 368 | | \\ stdout.print("after\n") catch unreachable; |
| 364 | \\ stdout.print("before\n", .{}) catch unreachable; |
| 365 | \\ defer stdout.print("defer1\n", .{}) catch unreachable; |
| 366 | \\ defer stdout.print("defer2\n", .{}) catch unreachable; |
| 367 | \\ defer stdout.print("defer3\n", .{}) catch unreachable; |
| 368 | \\ stdout.print("after\n", .{}) catch unreachable; |
| 369 | 369 | \\} |
| 370 | 370 | , "before\nafter\ndefer3\ndefer2\ndefer1\n"); |
| 371 | 371 | |
| ... | ... | @@ -374,13 +374,13 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 374 | 374 | \\const os = @import("std").os; |
| 375 | 375 | \\pub fn main() void { |
| 376 | 376 | \\ const stdout = &io.getStdOut().outStream().stream; |
| 377 | | \\ stdout.print("before\n") catch unreachable; |
| 378 | | \\ defer stdout.print("defer1\n") catch unreachable; |
| 379 | | \\ defer stdout.print("defer2\n") catch unreachable; |
| 377 | \\ stdout.print("before\n", .{}) catch unreachable; |
| 378 | \\ defer stdout.print("defer1\n", .{}) catch unreachable; |
| 379 | \\ defer stdout.print("defer2\n", .{}) catch unreachable; |
| 380 | 380 | \\ var args_it = @import("std").process.args(); |
| 381 | 381 | \\ if (args_it.skip() and !args_it.skip()) return; |
| 382 | | \\ defer stdout.print("defer3\n") catch unreachable; |
| 383 | | \\ stdout.print("after\n") catch unreachable; |
| 382 | \\ defer stdout.print("defer3\n", .{}) catch unreachable; |
| 383 | \\ stdout.print("after\n", .{}) catch unreachable; |
| 384 | 384 | \\} |
| 385 | 385 | , "before\ndefer2\ndefer1\n"); |
| 386 | 386 | |
| ... | ... | @@ -391,12 +391,12 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 391 | 391 | \\} |
| 392 | 392 | \\fn do_test() !void { |
| 393 | 393 | \\ const stdout = &io.getStdOut().outStream().stream; |
| 394 | | \\ stdout.print("before\n") catch unreachable; |
| 395 | | \\ defer stdout.print("defer1\n") catch unreachable; |
| 396 | | \\ errdefer stdout.print("deferErr\n") catch unreachable; |
| 394 | \\ stdout.print("before\n", .{}) catch unreachable; |
| 395 | \\ defer stdout.print("defer1\n", .{}) catch unreachable; |
| 396 | \\ errdefer stdout.print("deferErr\n", .{}) catch unreachable; |
| 397 | 397 | \\ try its_gonna_fail(); |
| 398 | | \\ defer stdout.print("defer3\n") catch unreachable; |
| 399 | | \\ stdout.print("after\n") catch unreachable; |
| 398 | \\ defer stdout.print("defer3\n", .{}) catch unreachable; |
| 399 | \\ stdout.print("after\n", .{}) catch unreachable; |
| 400 | 400 | \\} |
| 401 | 401 | \\fn its_gonna_fail() !void { |
| 402 | 402 | \\ return error.IToldYouItWouldFail; |
| ... | ... | @@ -410,12 +410,12 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 410 | 410 | \\} |
| 411 | 411 | \\fn do_test() !void { |
| 412 | 412 | \\ const stdout = &io.getStdOut().outStream().stream; |
| 413 | | \\ stdout.print("before\n") catch unreachable; |
| 414 | | \\ defer stdout.print("defer1\n") catch unreachable; |
| 415 | | \\ errdefer stdout.print("deferErr\n") catch unreachable; |
| 413 | \\ stdout.print("before\n", .{}) catch unreachable; |
| 414 | \\ defer stdout.print("defer1\n", .{}) catch unreachable; |
| 415 | \\ errdefer stdout.print("deferErr\n", .{}) catch unreachable; |
| 416 | 416 | \\ try its_gonna_pass(); |
| 417 | | \\ defer stdout.print("defer3\n") catch unreachable; |
| 418 | | \\ stdout.print("after\n") catch unreachable; |
| 417 | \\ defer stdout.print("defer3\n", .{}) catch unreachable; |
| 418 | \\ stdout.print("after\n", .{}) catch unreachable; |
| 419 | 419 | \\} |
| 420 | 420 | \\fn its_gonna_pass() anyerror!void { } |
| 421 | 421 | , "before\nafter\ndefer3\ndefer1\n"); |
| ... | ... | @@ -427,7 +427,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 427 | 427 | \\ |
| 428 | 428 | \\pub fn main() void { |
| 429 | 429 | \\ const stdout = &io.getStdOut().outStream().stream; |
| 430 | | \\ stdout.print(foo_txt) catch unreachable; |
| 430 | \\ stdout.print(foo_txt, .{}) catch unreachable; |
| 431 | 431 | \\} |
| 432 | 432 | , "1234\nabcd\n"); |
| 433 | 433 | |
| ... | ... | @@ -452,7 +452,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 452 | 452 | \\ _ = args_it.skip(); |
| 453 | 453 | \\ while (args_it.next(allocator)) |arg_or_err| : (index += 1) { |
| 454 | 454 | \\ const arg = try arg_or_err; |
| 455 | | \\ try stdout.print("{}: {}\n", index, arg); |
| 455 | \\ try stdout.print("{}: {}\n", .{index, arg}); |
| 456 | 456 | \\ } |
| 457 | 457 | \\} |
| 458 | 458 | , |
| ... | ... | @@ -493,7 +493,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 493 | 493 | \\ _ = args_it.skip(); |
| 494 | 494 | \\ while (args_it.next(allocator)) |arg_or_err| : (index += 1) { |
| 495 | 495 | \\ const arg = try arg_or_err; |
| 496 | | \\ try stdout.print("{}: {}\n", index, arg); |
| 496 | \\ try stdout.print("{}: {}\n", .{index, arg}); |
| 497 | 497 | \\ } |
| 498 | 498 | \\} |
| 499 | 499 | , |