Skip to content

Commit 53b99a1

Browse files
committed
---
yaml --- r: 347883 b: refs/heads/master c: 8e8f911 h: refs/heads/master i: 347881: 0f4aa3e 347879: da061a8
1 parent c6fc43e commit 53b99a1

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: a2fec998e899269038a6cf5d234354e6f34f7a1e
2+
refs/heads/master: 8e8f91145c8344ff7c733b85995039f091c99210
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/test/stdlib/KVOKeyPaths.swift

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
// RUN: %target-run-simple-swift | %FileCheck %s
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-build-swift %s -o %t/a.out
3+
// RUN: %target-codesign %t/a.out
4+
// RUN: %target-run %t/a.out | grep 'check-prefix' > %t/prefix-option
5+
// RUN: %target-run %t/a.out | %FileCheck -check-prefix=CHECK `cat %t/prefix-option` %s
26
// REQUIRES: executable_test
37

48
// REQUIRES: objc_interop
@@ -117,6 +121,16 @@ print("target removed")
117121
// Test NSKeyValueObservingCustomization issue with observing from the callbacks
118122
//===----------------------------------------------------------------------===//
119123

124+
// The following tests are only expected to pass when running with the
125+
// Swift 5.1 and later libraries.
126+
if #available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *) {
127+
print("-check-prefix=CHECK-51")
128+
} else {
129+
print("-check-prefix=DONT-CHECK")
130+
// Need at least one check, otherwise FileCheck will complain.
131+
// DONT-CHECK: {{.}}
132+
}
133+
120134
class Target2 : NSObject, NSKeyValueObservingCustomization {
121135
@objc dynamic var name: String?
122136

@@ -151,10 +165,10 @@ withExtendedLifetime(Target2()) { (target) in
151165
}
152166
print("observer removed")
153167

154-
// CHECK-LABEL: registering observer for Target2
155-
// CHECK-DAG: keyPathsAffectingValue: key == \.name: true
156-
// CHECK-DAG: automaticallyNotifiesObservers: key == \.name: true
157-
// CHECK-NEXT: observer removed
168+
// CHECK-51-LABEL: registering observer for Target2
169+
// CHECK-51-DAG: keyPathsAffectingValue: key == \.name: true
170+
// CHECK-51-DAG: automaticallyNotifiesObservers: key == \.name: true
171+
// CHECK-51-NEXT: observer removed
158172

159173
//===----------------------------------------------------------------------===//
160174
// Test NSSortDescriptor keyPath support
@@ -175,5 +189,5 @@ let descriptor = NSSortDescriptor(keyPath: \Sortable1.name, ascending: true)
175189
_ = NSSortDescriptor(keyPath: \Sortable2.name, ascending: true)
176190
print("keyPath == \\Sortable1.name:", descriptor.keyPath == \Sortable1.name)
177191

178-
// CHECK-LABEL: creating NSSortDescriptor
179-
// CHECK-NEXT: keyPath == \Sortable1.name: true
192+
// CHECK-51-LABEL: creating NSSortDescriptor
193+
// CHECK-51-NEXT: keyPath == \Sortable1.name: true

0 commit comments

Comments
 (0)