[utils] add support for expected-remarks to update-verify-tests.py

This commit is contained in:
Henrik G. Olsson
2025-11-07 18:09:42 -08:00
parent c246140d7f
commit 5db7926e09
2 changed files with 22 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
// RUN: %empty-directory(%t)
// RUN: split-file %s %t
// RUN: not %target-swift-frontend-verify -typecheck %t/test.swift -Rmodule-api-import 2>%t/output.txt
// RUN: %update-verify-tests < %t/output.txt
// RUN: %target-swift-frontend-verify -typecheck %t/test.swift -Rmodule-api-import
// RUN: %diff %t/test.swift %t/test.swift.expected
//--- test.swift
public typealias Foo = String
public typealias Bar = Optional<Int> // expected-remark@+1{{asdf}}
//--- test.swift.expected
// expected-remark@+1{{struct 'String' is imported via 'Swift'}}
public typealias Foo = String
// expected-remark@+2{{struct 'Int' is imported via 'Swift'}}
// expected-remark@+1{{generic enum 'Optional' is imported via 'Swift'}}
public typealias Bar = Optional<Int>

View File

@@ -185,7 +185,7 @@ class ExpansionDiagClose:
expected_diag_re = re.compile(
r"//(\s*)expected-([a-zA-Z-]*)(note|warning|error)(-re)?(@[+-]?\d+)?(:\d+)?(\s*)(\d+)?\{\{(.*)\}\}"
r"//(\s*)expected-([a-zA-Z-]*)(note|warning|error|remark)(-re)?(@[+-]?\d+)?(:\d+)?(\s*)(\d+)?\{\{(.*)\}\}"
)
expected_expansion_diag_re = re.compile(
r"//(\s*)expected-([a-zA-Z-]*)(expansion)(-re)?(@[+-]?\d+)(:\d+)(\s*)(\d+)?\{\{(.*)"