Skip to content

Commit 1c86dd7

Browse files
committed
[Tests] NFC: Add a test-case for printing child notes associated with errors/warnings
1 parent b7eecc3 commit 1c86dd7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/diagnostics/pretty-printed-diagnostics.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ foo(b:
6666
1,
6767
a: 2)
6868
69+
// Test for child notes attached directly to a "primary" error/warning diagnostic
70+
func test(a: Int) {}
71+
func test(a: Int) {}
6972

7073
// Test fallback for non-ASCII characters.
7174
// CHECK: SOURCE_DIR{{[/\]+}}test{{[/\]+}}diagnostics{{[/\]+}}pretty-printed-diagnostics.swift:[[#LINE:]]:11
@@ -85,3 +88,7 @@ foo(b:
8588
// CHECK: [[#LINE]] | foo(b: 1, a: 2)
8689
// CHECK: | `- error: argument 'a' must precede argument 'b'
8790
// CHECK: [[#LINE+1]] |
91+
92+
// CHECK: SOURCE_DIR{{[/\]+}}test{{[/\]+}}diagnostics{{[/\]+}}pretty-printed-diagnostics.swift:[[#LINE:]]:6
93+
// CHECK: [[#LINE-1]] | func test(a: Int) {}
94+
// CHECK: | `- note: 'test(a:)' previously declared here

0 commit comments

Comments
 (0)