mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[utils] add support for expected-remarks to update-verify-tests.py
This commit is contained in:
21
test/Utils/update-verify-tests/remarks.swift
Normal file
21
test/Utils/update-verify-tests/remarks.swift
Normal 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>
|
||||
|
||||
@@ -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+)?\{\{(.*)"
|
||||
|
||||
Reference in New Issue
Block a user