Add a newline after diagnostic output when testing (#4818)

This removes some churn when adding new diagnostic cases to test files
(where previous to this change the newly added newline would cause the
previous diagnostic CHECKs to be updated including changes to the line
number because the CHECK for the blank line meant an extra line between
CHECK and source line).

A few alternatives discussed here:
https://discord.com/channels/655572317891461132/655578254970716160/1329573358475673723

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
David Blaikie
2025-01-16 23:23:57 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins
parent a8b46cf561
commit e6c1f0630a
582 changed files with 2575 additions and 1988 deletions
@@ -8,9 +8,10 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_missing_name.carbon
// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName]
// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+4]]:4: error: `fn` introducer should be followed by a name [ExpectedDeclName]
// CHECK:STDERR: fn ();
// CHECK:STDERR: ^
// CHECK:STDERR:
fn ();
// CHECK:STDOUT: - filename: fail_missing_name.carbon