Skip to content

Commit db22dec

Browse files
committed
DarwinCompatibility: Restore tests to compiling and working
- Add new test files.
1 parent a702cf3 commit db22dec

14 files changed

+143
-32
lines changed

DarwinCompatibilityTests.xcodeproj/project.pbxproj

+46-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@
88

99
/* Begin PBXBuildFile section */
1010
1560EA8C219217F8004377E9 /* TestNSCalendar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1560EA8B219217F8004377E9 /* TestNSCalendar.swift */; };
11+
B906C30122AC6CE700FCFA2D /* TestNSSortDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B906C2FF22AC6CE600FCFA2D /* TestNSSortDescriptor.swift */; };
12+
B906C30222AC6CE700FCFA2D /* TestURLSessionFTP.swift in Sources */ = {isa = PBXBuildFile; fileRef = B906C30022AC6CE600FCFA2D /* TestURLSessionFTP.swift */; };
13+
B906C30422AC6E2A00FCFA2D /* FTPServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = B906C30322AC6E2A00FCFA2D /* FTPServer.swift */; };
1114
B907F36F20BB188800013CBE /* NSString-ISO-8859-1-data.txt in Resources */ = {isa = PBXBuildFile; fileRef = B907F36E20BB188800013CBE /* NSString-ISO-8859-1-data.txt */; };
15+
B91269F622857B7100C78241 /* TestUUID.swift in Sources */ = {isa = PBXBuildFile; fileRef = B91269EE22857B7000C78241 /* TestUUID.swift */; };
16+
B91269F722857B7100C78241 /* TestDateInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = B91269EF22857B7000C78241 /* TestDateInterval.swift */; };
17+
B91269F822857B7100C78241 /* TestMeasurement.swift in Sources */ = {isa = PBXBuildFile; fileRef = B91269F022857B7000C78241 /* TestMeasurement.swift */; };
18+
B91269F922857B7100C78241 /* TestHost.swift in Sources */ = {isa = PBXBuildFile; fileRef = B91269F122857B7000C78241 /* TestHost.swift */; };
19+
B91269FA22857B7100C78241 /* TestNSLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B91269F322857B7100C78241 /* TestNSLock.swift */; };
20+
B91269FB22857B7100C78241 /* TestDateComponents.swift in Sources */ = {isa = PBXBuildFile; fileRef = B91269F522857B7100C78241 /* TestDateComponents.swift */; };
1221
B917D32420B0DB9700728EE0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B917D32320B0DB9700728EE0 /* Foundation.framework */; };
1322
B917D32620B0DE2000728EE0 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = B917D32520B0DE2000728EE0 /* main.swift */; };
1423
B940492B223B13D000FB4384 /* TestProgressFraction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B940492A223B13D000FB4384 /* TestProgressFraction.swift */; };
@@ -154,7 +163,19 @@
154163

155164
/* Begin PBXFileReference section */
156165
1560EA8B219217F8004377E9 /* TestNSCalendar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestNSCalendar.swift; path = TestFoundation/TestNSCalendar.swift; sourceTree = "<group>"; };
166+
B906C2FF22AC6CE600FCFA2D /* TestNSSortDescriptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNSSortDescriptor.swift; path = TestFoundation/TestNSSortDescriptor.swift; sourceTree = "<group>"; };
167+
B906C30022AC6CE600FCFA2D /* TestURLSessionFTP.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestURLSessionFTP.swift; path = TestFoundation/TestURLSessionFTP.swift; sourceTree = "<group>"; };
168+
B906C30322AC6E2A00FCFA2D /* FTPServer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = FTPServer.swift; path = TestFoundation/FTPServer.swift; sourceTree = "<group>"; };
157169
B907F36E20BB188800013CBE /* NSString-ISO-8859-1-data.txt */ = {isa = PBXFileReference; lastKnownFileType = text; name = "NSString-ISO-8859-1-data.txt"; path = "TestFoundation/Resources/NSString-ISO-8859-1-data.txt"; sourceTree = "<group>"; };
170+
B91269ED22857B7000C78241 /* TestNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNotification.swift; path = TestFoundation/TestNotification.swift; sourceTree = "<group>"; };
171+
B91269EE22857B7000C78241 /* TestUUID.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestUUID.swift; path = TestFoundation/TestUUID.swift; sourceTree = "<group>"; };
172+
B91269EF22857B7000C78241 /* TestDateInterval.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestDateInterval.swift; path = TestFoundation/TestDateInterval.swift; sourceTree = "<group>"; };
173+
B91269F022857B7000C78241 /* TestMeasurement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestMeasurement.swift; path = TestFoundation/TestMeasurement.swift; sourceTree = "<group>"; };
174+
B91269F122857B7000C78241 /* TestHost.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestHost.swift; path = TestFoundation/TestHost.swift; sourceTree = "<group>"; };
175+
B91269F222857B7100C78241 /* TestNotificationQueue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNotificationQueue.swift; path = TestFoundation/TestNotificationQueue.swift; sourceTree = "<group>"; };
176+
B91269F322857B7100C78241 /* TestNSLock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNSLock.swift; path = TestFoundation/TestNSLock.swift; sourceTree = "<group>"; };
177+
B91269F422857B7100C78241 /* TestNotificationCenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNotificationCenter.swift; path = TestFoundation/TestNotificationCenter.swift; sourceTree = "<group>"; };
178+
B91269F522857B7100C78241 /* TestDateComponents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestDateComponents.swift; path = TestFoundation/TestDateComponents.swift; sourceTree = "<group>"; };
158179
B917D31C20B0DB8B00728EE0 /* xdgTestHelper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = xdgTestHelper; sourceTree = BUILT_PRODUCTS_DIR; };
159180
B917D32320B0DB9700728EE0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
160181
B917D32520B0DE2000728EE0 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = main.swift; path = TestFoundation/xdgTestHelper/main.swift; sourceTree = "<group>"; };
@@ -231,7 +252,7 @@
231252
B9C89F221F6BF89800087AF4 /* TestNSCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNSCache.swift; path = TestFoundation/TestNSCache.swift; sourceTree = "<group>"; };
232253
B9C89F231F6BF89800087AF4 /* TestNSDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNSDictionary.swift; path = TestFoundation/TestNSDictionary.swift; sourceTree = "<group>"; };
233254
B9C89F241F6BF89800087AF4 /* TestNotificationCenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNotificationCenter.swift; path = TestFoundation/TestNotificationCenter.swift; sourceTree = "<group>"; };
234-
B9C89F251F6BF89800087AF4 /* TestProcess.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestProcess.swift; path = TestFoundation/TestProcess.swift; sourceTree = "<group>"; };
255+
B9C89F251F6BF89800087AF4 /* TestProcess.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestProcess.swift; path = TestFoundation/TestProcess.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
235256
B9C89F261F6BF89900087AF4 /* TestEnergyFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestEnergyFormatter.swift; path = TestFoundation/TestEnergyFormatter.swift; sourceTree = "<group>"; };
236257
B9C89F271F6BF89900087AF4 /* TestNSCompoundPredicate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNSCompoundPredicate.swift; path = TestFoundation/TestNSCompoundPredicate.swift; sourceTree = "<group>"; };
237258
B9C89F281F6BF89900087AF4 /* TestNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNotification.swift; path = TestFoundation/TestNotification.swift; sourceTree = "<group>"; };
@@ -301,6 +322,18 @@
301322
B9C89EB81F6BF47D00087AF4 = {
302323
isa = PBXGroup;
303324
children = (
325+
B906C30322AC6E2A00FCFA2D /* FTPServer.swift */,
326+
B906C2FF22AC6CE600FCFA2D /* TestNSSortDescriptor.swift */,
327+
B906C30022AC6CE600FCFA2D /* TestURLSessionFTP.swift */,
328+
B91269F522857B7100C78241 /* TestDateComponents.swift */,
329+
B91269EF22857B7000C78241 /* TestDateInterval.swift */,
330+
B91269F122857B7000C78241 /* TestHost.swift */,
331+
B91269F022857B7000C78241 /* TestMeasurement.swift */,
332+
B91269ED22857B7000C78241 /* TestNotification.swift */,
333+
B91269F422857B7100C78241 /* TestNotificationCenter.swift */,
334+
B91269F222857B7100C78241 /* TestNotificationQueue.swift */,
335+
B91269F322857B7100C78241 /* TestNSLock.swift */,
336+
B91269EE22857B7000C78241 /* TestUUID.swift */,
304337
B9C1C63322607372002BBEA0 /* FixtureValues.swift */,
305338
B940492A223B13D000FB4384 /* TestProgressFraction.swift */,
306339
B97E7855222AF995007596B0 /* TestPropertyListEncoder.swift */,
@@ -569,6 +602,18 @@
569602
isa = PBXSourcesBuildPhase;
570603
buildActionMask = 2147483647;
571604
files = (
605+
B906C30422AC6E2A00FCFA2D /* FTPServer.swift in Sources */,
606+
B906C30122AC6CE700FCFA2D /* TestNSSortDescriptor.swift in Sources */,
607+
B906C30222AC6CE700FCFA2D /* TestURLSessionFTP.swift in Sources */,
608+
B9C89F771F6BF89C00087AF4 /* TestNotification.swift in Sources */,
609+
B91269F622857B7100C78241 /* TestUUID.swift in Sources */,
610+
B91269F722857B7100C78241 /* TestDateInterval.swift in Sources */,
611+
B91269F822857B7100C78241 /* TestMeasurement.swift in Sources */,
612+
B91269F922857B7100C78241 /* TestHost.swift in Sources */,
613+
B9C89F7F1F6BF89C00087AF4 /* TestNotificationQueue.swift in Sources */,
614+
B91269FA22857B7100C78241 /* TestNSLock.swift in Sources */,
615+
B9C89F731F6BF89C00087AF4 /* TestNotificationCenter.swift in Sources */,
616+
B91269FB22857B7100C78241 /* TestDateComponents.swift in Sources */,
572617
B9C1C63422607372002BBEA0 /* FixtureValues.swift in Sources */,
573618
B940492B223B13D000FB4384 /* TestProgressFraction.swift in Sources */,
574619
B97E7856222AF995007596B0 /* TestPropertyListEncoder.swift in Sources */,
@@ -639,18 +684,15 @@
639684
B9C89F701F6BF89C00087AF4 /* TestDecimal.swift in Sources */,
640685
B9C89F711F6BF89C00087AF4 /* TestNSCache.swift in Sources */,
641686
B9C89F721F6BF89C00087AF4 /* TestNSDictionary.swift in Sources */,
642-
B9C89F731F6BF89C00087AF4 /* TestNotificationCenter.swift in Sources */,
643687
B9C89F741F6BF89C00087AF4 /* TestProcess.swift in Sources */,
644688
B9C89F751F6BF89C00087AF4 /* TestEnergyFormatter.swift in Sources */,
645689
B9C89F761F6BF89C00087AF4 /* TestNSCompoundPredicate.swift in Sources */,
646-
B9C89F771F6BF89C00087AF4 /* TestNotification.swift in Sources */,
647690
B9C89F781F6BF89C00087AF4 /* TestNSData.swift in Sources */,
648691
B9C89F791F6BF89C00087AF4 /* TestNSRange.swift in Sources */,
649692
B9C89F7A1F6BF89C00087AF4 /* TestNSGeometry.swift in Sources */,
650693
B9C89F7C1F6BF89C00087AF4 /* TestURLCredential.swift in Sources */,
651694
B9C89F7D1F6BF89C00087AF4 /* TestRunLoop.swift in Sources */,
652695
B9C89F7E1F6BF89C00087AF4 /* TestThread.swift in Sources */,
653-
B9C89F7F1F6BF89C00087AF4 /* TestNotificationQueue.swift in Sources */,
654696
B9C89F801F6BF89C00087AF4 /* TestJSONSerialization.swift in Sources */,
655697
B9C89F811F6BF89C00087AF4 /* TestAffineTransform.swift in Sources */,
656698
B9C89F821F6BF89C00087AF4 /* TestNSURLRequest.swift in Sources */,

DarwinCompatibilityTests.xcodeproj/xcshareddata/xcschemes/xdgTestHelper.xcscheme

+9-13
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<MacroExpansion>
31+
<BuildableReference
32+
BuildableIdentifier = "primary"
33+
BlueprintIdentifier = "B917D31B20B0DB8B00728EE0"
34+
BuildableName = "xdgTestHelper"
35+
BlueprintName = "xdgTestHelper"
36+
ReferencedContainer = "container:DarwinCompatibilityTests.xcodeproj">
37+
</BuildableReference>
38+
</MacroExpansion>
3039
<Testables>
3140
<TestableReference
3241
skipped = "NO">
@@ -50,17 +59,6 @@
5059
</SkippedTests>
5160
</TestableReference>
5261
</Testables>
53-
<MacroExpansion>
54-
<BuildableReference
55-
BuildableIdentifier = "primary"
56-
BlueprintIdentifier = "B917D31B20B0DB8B00728EE0"
57-
BuildableName = "xdgTestHelper"
58-
BlueprintName = "xdgTestHelper"
59-
ReferencedContainer = "container:DarwinCompatibilityTests.xcodeproj">
60-
</BuildableReference>
61-
</MacroExpansion>
62-
<AdditionalOptions>
63-
</AdditionalOptions>
6462
</TestAction>
6563
<LaunchAction
6664
buildConfiguration = "Debug"
@@ -82,8 +80,6 @@
8280
ReferencedContainer = "container:DarwinCompatibilityTests.xcodeproj">
8381
</BuildableReference>
8482
</BuildableProductRunnable>
85-
<AdditionalOptions>
86-
</AdditionalOptions>
8783
</LaunchAction>
8884
<ProfileAction
8985
buildConfiguration = "Release"

Foundation/NSArray.swift

+9-1
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,19 @@ open class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NSCo
218218

219219
open func description(withLocale locale: Locale?, indent level: Int) -> String {
220220
var descriptions = [String]()
221+
var nonAlphaNum = CharacterSet.alphanumerics
222+
nonAlphaNum.invert()
221223
let cnt = count
222224
for idx in 0..<cnt {
223225
let obj = self[idx]
224226
if let string = obj as? String {
225-
descriptions.append(string)
227+
if string.isEmpty {
228+
descriptions.append("\"\"")
229+
} else if string.rangeOfCharacter(from: nonAlphaNum) != nil {
230+
descriptions.append("\"\(string)\"")
231+
} else {
232+
descriptions.append(string)
233+
}
226234
} else if let array = obj as? [Any] {
227235
descriptions.append(NSArray(array: array).description(withLocale: locale, indent: level + 1))
228236
} else if let dict = obj as? [AnyHashable : Any] {

TestFoundation/TestBundle.swift

+12-5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ internal func testBundle() -> Bundle {
3030
#endif
3131
}
3232

33+
34+
#if DARWIN_COMPATIBILITY_TESTS
35+
extension Bundle {
36+
static let _supportsFreestandingBundles = false
37+
static let _supportsFHSBundles = false
38+
}
39+
#endif
40+
41+
3342
internal func testBundleName() -> String {
3443
// Either 'TestFoundation' or 'DarwinCompatibilityTests'
3544
return testBundle().infoDictionary!["CFBundleName"] as! String
@@ -521,7 +530,8 @@ class TestBundle : XCTestCase {
521530
XCTAssertNil(bundle.url(forAuxiliaryExecutable: "does_not_exist_at_all"))
522531
}
523532
}
524-
533+
534+
#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
525535
func test_bundleReverseBundleLookup() {
526536
_withEachPlaygroundLayout { (playground) in
527537
#if !os(Windows)
@@ -542,15 +552,12 @@ class TestBundle : XCTestCase {
542552
}
543553
}
544554

545-
#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
546555
func test_mainBundleExecutableURL() {
547-
#if !DARWIN_COMPATIBILITY_TESTS // _CFProcessPath() is unavailable on native Foundation
548556
let maybeURL = Bundle.main.executableURL
549557
XCTAssertNotNil(maybeURL)
550558
guard let url = maybeURL else { return }
551559

552560
XCTAssertEqual(url.path, ProcessInfo.processInfo._processPath)
553-
#endif
554561
}
555562
#endif
556563

@@ -571,13 +578,13 @@ class TestBundle : XCTestCase {
571578
("test_bundlePreflight", test_bundlePreflight),
572579
("test_bundleFindExecutable", test_bundleFindExecutable),
573580
("test_bundleFindAuxiliaryExecutables", test_bundleFindAuxiliaryExecutables),
574-
("test_bundleReverseBundleLookup", test_bundleReverseBundleLookup),
575581
("test_bundleForClass", testExpectedToFailOnWindows(test_bundleForClass, "Functionality not yet implemented on Windows. SR-XXXX")),
576582
]
577583

578584
#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
579585
tests.append(contentsOf: [
580586
("test_mainBundleExecutableURL", test_mainBundleExecutableURL),
587+
("test_bundleReverseBundleLookup", test_bundleReverseBundleLookup),
581588
])
582589
#endif
583590

TestFoundation/TestFileManager.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -1647,11 +1647,13 @@ VIDEOS=StopgapVideos
16471647
try runSingleTest(aIsDirectory: true, bIsDirectory: false, options: .usingNewMetadataOnly)
16481648
try runSingleTest(aIsDirectory: true, bIsDirectory: false, options: [.withoutDeletingBackupItem, .usingNewMetadataOnly])
16491649
}
1650-
1650+
1651+
#if !DARWIN_COMPATIBILITY_TESTS
16511652
print("note: Testing platform-specific replace implementation.", to: &stderr)
16521653
try testReplaceMethod { (a, b, backupItemName, options) -> URL? in
16531654
try fm.replaceItem(at: a, withItemAt: b, backupItemName: backupItemName, options: options)
16541655
}
1656+
#endif
16551657

16561658
#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
16571659
print("note: Testing cross-platform replace implementation.", to: &stderr)

TestFoundation/TestImports.swift

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
@_exported import SwiftXCTest
1616
#else
1717
@_exported import Foundation
18+
#if canImport(FoundationNetworking)
1819
@_exported import FoundationNetworking
20+
#endif
1921
@_exported import XCTest
2022
#endif

TestFoundation/TestMeasurement.swift

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10+
#if !DARWIN_COMPATIBILITY_TESTS // https://bugs.swift.org/browse/SR-10904
1011
class CustomUnit: Unit {
1112
required init(symbol: String) {
1213
super.init(symbol: symbol)
@@ -19,6 +20,7 @@ class CustomUnit: Unit {
1920
public static let bugs = CustomUnit(symbol: "bug")
2021
public static let features = CustomUnit(symbol: "feature")
2122
}
23+
#endif
2224

2325
class TestMeasurement: XCTestCase {
2426
static var allTests: [(String, (TestMeasurement) -> () throws -> Void)] {
@@ -59,6 +61,7 @@ class TestMeasurement: XCTestCase {
5961
]
6062
checkHashableGroups(durations)
6163

64+
#if !DARWIN_COMPATIBILITY_TESTS
6265
let custom: [Measurement<CustomUnit>] = [
6366
Measurement(value: 1, unit: CustomUnit.bugs),
6467
Measurement(value: 2, unit: CustomUnit.bugs),
@@ -70,6 +73,7 @@ class TestMeasurement: XCTestCase {
7073
Measurement(value: 4, unit: CustomUnit.features),
7174
]
7275
checkHashable(custom, equalityOracle: { $0 == $1 })
76+
#endif
7377
}
7478

7579
}

TestFoundation/TestNSSet.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,16 @@ class TestNSSet : XCTestCase {
231231
}
232232

233233
func test_description() {
234-
let array = NSArray(array: ["array_element1", "array_element2"])
234+
let array = NSArray(array: ["array_element1", "arrayElement2", "", "!@#$%^&*()", "a+b"])
235235
let dictionary = NSDictionary(dictionary: ["key1": "value1", "key2": "value2"])
236236
let innerSet = NSSet(array: [4444, 5555])
237237
let set: NSSet = NSSet(array: [array, dictionary, innerSet, 1111, 2222, 3333])
238238

239239
let description = NSString(string: set.description)
240-
241-
XCTAssertTrue(description.substring(to: 2).isEqual(to: "{("))
242-
XCTAssertTrue(description.substring(from: description.length - 2).isEqual(to: ")}"))
243-
XCTAssertTrue(description.contains(" (\n array_element1,\n array_element2\n )"))
240+
241+
XCTAssertTrue(description.hasPrefix("{("))
242+
XCTAssertTrue(description.hasSuffix(")}"))
243+
XCTAssertTrue(description.contains(" (\n \"array_element1\",\n arrayElement2,\n \"\",\n \"!@#$%^&*()\",\n \"a+b\"\n )"))
244244
XCTAssertTrue(description.contains(" key1 = value1"))
245245
XCTAssertTrue(description.contains(" key2 = value2"))
246246
XCTAssertTrue(description.contains(" 4444"))

TestFoundation/TestNSSortDescriptor.swift

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10+
#if !DARWIN_COMPATIBILITY_TESTS
1011
struct IntSortable {
1112
var value: Int
1213
}
@@ -233,3 +234,4 @@ class TestNSSortDescriptor: XCTestCase {
233234
]
234235
}
235236
}
237+
#endif

TestFoundation/TestNSString.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1054,10 +1054,12 @@ class TestNSString: LoopbackServerTest {
10541054
}
10551055

10561056
do {
1057+
#if !DARWIN_COMPATIBILITY_TESTS // https://bugs.swift.org/browse/SR-10916
10571058
let path: NSString = "~/foo/bar/"
10581059
let result = path.standardizingPath
10591060
let expected = NSHomeDirectory().appendingPathComponent("foo/bar")
10601061
XCTAssertEqual(result, expected, "standardizingPath expanding initial tilde.")
1062+
#endif
10611063
}
10621064

10631065
// relative file paths depend on file path standardizing that is not yet implemented

0 commit comments

Comments
 (0)