Skip to content

Commit a60304c

Browse files
xedinktoso
authored andcommitted
[Tests] NFC: Add a test-case for printing child notes associated with errors/warnings
1 parent 83db275 commit a60304c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/diagnostics/pretty-printed-diagnostics.swift

Lines changed: 9 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,9 @@ 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
95+
// CHECK: [[#LINE]] | func test(a: Int) {}
96+
// CHECL: [[#LINE+1]] | `- error: invalid redeclaration of 'test(a:)'

0 commit comments

Comments
 (0)