[Tests] NFC: Add a test-case for printing child notes associated with errors/warnings

This commit is contained in:
Pavel Yaskevich
2025-03-06 15:15:08 -08:00
parent b7eecc32dc
commit b26c8aa930

View File

@@ -66,6 +66,9 @@ foo(b:
1,
a: 2)
// Test for child notes attached directly to a "primary" error/warning diagnostic
func test(a: Int) {}
func test(a: Int) {}
// Test fallback for non-ASCII characters.
// CHECK: SOURCE_DIR{{[/\]+}}test{{[/\]+}}diagnostics{{[/\]+}}pretty-printed-diagnostics.swift:[[#LINE:]]:11
@@ -85,3 +88,9 @@ foo(b:
// CHECK: [[#LINE]] | foo(b: 1, a: 2)
// CHECK: | `- error: argument 'a' must precede argument 'b'
// CHECK: [[#LINE+1]] |
// CHECK: SOURCE_DIR{{[/\]+}}test{{[/\]+}}diagnostics{{[/\]+}}pretty-printed-diagnostics.swift:[[#LINE:]]:6
// CHECK: [[#LINE-1]] | func test(a: Int) {}
// CHECK: | `- note: 'test(a:)' previously declared here
// CHECK: [[#LINE]] | func test(a: Int) {}
// CHECL: [[#LINE+1]] | `- error: invalid redeclaration of 'test(a:)'