Skip to content

Commit 27443e0

Browse files
fix test to match multiple lines at once (#72396)
1 parent 46e372c commit 27443e0

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

test/SymbolGraph/Relationships/Synthesized/ConditionalConformance.swift

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
// RUN: %FileCheck %s --input-file %t/ConditionalConformance.symbols.json --check-prefix=CONFORMS
88
// RUN: %FileCheck %s --input-file %t/ConditionalConformance.symbols.json --check-prefix=MEMBER
99

10-
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=SYNTHEXT,EBSOff_SYNTHEXT
11-
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=CONFORMSEXT,EBSOff_CONFORMSEXT
12-
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=MEMBEREXT,EBSOff_MEMBEREXT
10+
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=SYNTHEXT -DEXTID=s:Sa
11+
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=CONFORMSEXT -DEXTID=s:Sa
12+
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=MEMBEREXT -DEXTID=s:Sa
1313

1414
// RUN: %empty-directory(%t)
1515
// RUN: %target-build-swift %s -module-name ConditionalConformance -emit-module -emit-module-path %t/
@@ -20,9 +20,9 @@
2020
// RUN: %FileCheck %s --input-file %t/ConditionalConformance.symbols.json --check-prefix=CONFORMS
2121
// RUN: %FileCheck %s --input-file %t/ConditionalConformance.symbols.json --check-prefix=MEMBER
2222

23-
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=SYNTHEXT,EBSOn_SYNTHEXT
24-
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=CONFORMSEXT,EBSOn_CONFORMSEXT
25-
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=MEMBEREXT,EBSOn_MEMBEREXT
23+
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=SYNTHEXT -DEXTID=s:e:s:Sa22ConditionalConformanceSiRszlE3baryyF
24+
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=CONFORMSEXT -DEXTID=s:e:s:Sa22ConditionalConformanceSiRszlE3baryyF
25+
// RUN: %FileCheck %s --input-file %t/[email protected] --check-prefixes=MEMBEREXT -DEXTID=s:e:s:Sa22ConditionalConformanceSiRszlE3baryyF
2626

2727
// Relationships to Swift.Array should only go into the @Swift file.
2828
// C\HECK-NOT: "s:Sa"
@@ -42,10 +42,9 @@ public struct S<T> {
4242
}
4343
}
4444

45-
// CONFORMS: "kind": "conformsTo"
46-
// CONFORMS-NEXT: "source": "s:22ConditionalConformance1SV"
47-
// CONFORMS-NEXT: "target": "s:22ConditionalConformance1PP"
48-
// CONFORMS-NEXT: swiftConstraints
45+
// S<Int> will also have synthesized conformances to Copyable and Escapable, so match multiple lines
46+
// at once to make sure we only find the conformance we want to see
47+
// CONFORMS: "kind": "conformsTo"{{.*[[:space:]].*}} "source": "s:22ConditionalConformance1SV"{{.*[[:space:]].*}} "target": "s:22ConditionalConformance1PP"{{.*[[:space:]].*}} "swiftConstraints"
4948
// CONFORMS: "kind": "sameType"
5049
// CONFORMS-NEXT: "lhs": "T"
5150
// CONFORMS-NEXT: "rhs": "Int"
@@ -61,22 +60,16 @@ extension S: P where T == Int {
6160
}
6261
}
6362

64-
// CONFORMSEXT: "kind": "conformsTo"
65-
// EBSOff_CONFORMSEXT-NEXT: "source": "s:Sa"
66-
// EBSOn_CONFORMSEXT-NEXT: "source": "s:e:s:Sa22ConditionalConformanceSiRszlE3baryyF"
67-
// CONFORMSEXT-NEXT: "target": "s:22ConditionalConformance1PP"
68-
// CONFORMSEXT-NEXT: swiftConstraints
63+
// CONFORMSEXT: "kind": "conformsTo"{{.*[[:space:]].*}} "source": "[[EXTID]]"{{.*[[:space:]].*}} "target": "s:22ConditionalConformance1PP"{{.*[[:space:]].*}} "swiftConstraints"
6964
// CONFORMSEXT: "kind": "sameType"
7065
// CONFORMSEXT-NEXT: "lhs": "Element"
7166
// CONFORMSEXT-NEXT: "rhs": "Int"
7267

7368
extension Array: P where Element == Int {
7469
// SYNTHEXT: "source": "s:22ConditionalConformance1PPAAE3fooyyF::SYNTHESIZED::s:Sa"
75-
// EBSOff_SYNTHEXT-NEXT: "target": "s:Sa"
76-
// EBSOn_SYNTHEXT-NEXT: "target": "s:e:s:Sa22ConditionalConformanceSiRszlE3baryyF"
70+
// SYNTHEXT-NEXT: "target": "[[EXTID]]"
7771

7872
// MEMBEREXT: "source": "s:Sa22ConditionalConformanceSiRszlE3baryyF"
79-
// EBSOff_MEMBEREXT-NEXT: "target": "s:Sa"
80-
// EBSOn_MEMBEREXT-NEXT: "target": "s:e:s:Sa22ConditionalConformanceSiRszlE3baryyF"
73+
// MEMBEREXT-NEXT: "target": "[[EXTID]]"
8174
public func bar() {}
8275
}

0 commit comments

Comments
 (0)