Skip to content

Commit 5db7926

Browse files
committed
[utils] add support for expected-remarks to update-verify-tests.py
1 parent c246140 commit 5db7926

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: split-file %s %t
3+
4+
// RUN: not %target-swift-frontend-verify -typecheck %t/test.swift -Rmodule-api-import 2>%t/output.txt
5+
// RUN: %update-verify-tests < %t/output.txt
6+
// RUN: %target-swift-frontend-verify -typecheck %t/test.swift -Rmodule-api-import
7+
// RUN: %diff %t/test.swift %t/test.swift.expected
8+
9+
//--- test.swift
10+
public typealias Foo = String
11+
12+
public typealias Bar = Optional<Int> // expected-remark@+1{{asdf}}
13+
14+
//--- test.swift.expected
15+
// expected-remark@+1{{struct 'String' is imported via 'Swift'}}
16+
public typealias Foo = String
17+
18+
// expected-remark@+2{{struct 'Int' is imported via 'Swift'}}
19+
// expected-remark@+1{{generic enum 'Optional' is imported via 'Swift'}}
20+
public typealias Bar = Optional<Int>
21+

utils/update_verify_tests/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def render(self):
185185

186186

187187
expected_diag_re = re.compile(
188-
r"//(\s*)expected-([a-zA-Z-]*)(note|warning|error)(-re)?(@[+-]?\d+)?(:\d+)?(\s*)(\d+)?\{\{(.*)\}\}"
188+
r"//(\s*)expected-([a-zA-Z-]*)(note|warning|error|remark)(-re)?(@[+-]?\d+)?(:\d+)?(\s*)(\d+)?\{\{(.*)\}\}"
189189
)
190190
expected_expansion_diag_re = re.compile(
191191
r"//(\s*)expected-([a-zA-Z-]*)(expansion)(-re)?(@[+-]?\d+)(:\d+)(\s*)(\d+)?\{\{(.*)"

0 commit comments

Comments
 (0)