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