Skip to content

Commit 01847c6

Browse files
committed
[Test] Use Async library & fix race-condition in Xcode6-GM by adding more delay.
1 parent a49abc5 commit 01847c6

File tree

7 files changed

+87
-86
lines changed

7 files changed

+87
-86
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "Vendor/Alamofire"]
55
path = Vendor/Alamofire
66
url = https://github.com/inamiy/Alamofire.git
7+
[submodule "Vendor/Async"]
8+
path = Vendor/Async
9+
url = https://github.com/duemunk/Async.git

SwiftTask.xcodeproj/project.pbxproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
1F0E284019C1DEA0005EF467 /* Async.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F0E282319C1DEA0005EF467 /* Async.swift */; };
1011
1F2024FF19AD97A700DE0495 /* CustomOperatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F2024FE19AD97A700DE0495 /* CustomOperatorTests.swift */; };
1112
1F20250219ADA8FD00DE0495 /* BasicTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F20250119ADA8FD00DE0495 /* BasicTests.swift */; };
1213
1F46DEDA199EDF1000F97868 /* SwiftTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F46DED9199EDF1000F97868 /* SwiftTask.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -48,6 +49,7 @@
4849
/* End PBXContainerItemProxy section */
4950

5051
/* Begin PBXFileReference section */
52+
1F0E282319C1DEA0005EF467 /* Async.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Async.swift; sourceTree = "<group>"; };
5153
1F2024FE19AD97A700DE0495 /* CustomOperatorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomOperatorTests.swift; sourceTree = "<group>"; };
5254
1F20250119ADA8FD00DE0495 /* BasicTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasicTests.swift; sourceTree = "<group>"; };
5355
1F46DED4199EDF1000F97868 /* SwiftTask.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftTask.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -93,6 +95,14 @@
9395
/* End PBXFrameworksBuildPhase section */
9496

9597
/* Begin PBXGroup section */
98+
1F0E282119C1DEA0005EF467 /* Async */ = {
99+
isa = PBXGroup;
100+
children = (
101+
1F0E282319C1DEA0005EF467 /* Async.swift */,
102+
);
103+
path = Async;
104+
sourceTree = "<group>";
105+
};
96106
1F46DECA199EDF1000F97868 = {
97107
isa = PBXGroup;
98108
children = (
@@ -158,6 +168,7 @@
158168
children = (
159169
1FA4631E19A8D70A00DD8729 /* SwiftState */,
160170
1FA4631319A8D70A00DD8729 /* Alamofire */,
171+
1F0E282119C1DEA0005EF467 /* Async */,
161172
);
162173
path = Vendor;
163174
sourceTree = "<group>";
@@ -297,6 +308,7 @@
297308
hasScannedForEncodings = 0;
298309
knownRegions = (
299310
en,
311+
Base,
300312
);
301313
mainGroup = 1F46DECA199EDF1000F97868;
302314
productRefGroup = 1F46DED5199EDF1000F97868 /* Products */;
@@ -381,6 +393,7 @@
381393
1FA4634919A8D73300DD8729 /* Alamofire.swift in Sources */,
382394
1F20250219ADA8FD00DE0495 /* BasicTests.swift in Sources */,
383395
1F6A8CA619A5090E00369A5D /* AlamofireTests.swift in Sources */,
396+
1F0E284019C1DEA0005EF467 /* Async.swift in Sources */,
384397
1F6A8CA319A4E4F200369A5D /* SwiftTaskTests.swift in Sources */,
385398
48511C5B19C17563002FE03C /* RetainCycleTests.swift in Sources */,
386399
1F46DEFD199EE2C200F97868 /* _TestCase.swift in Sources */,

SwiftTaskTests/BasicTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class BasicTests: _TestCase
2121
// define task
2222
let task = Task { (progress, fulfill, reject, configure) in
2323

24-
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 100_000_000), dispatch_get_main_queue()) {
24+
Async.main(after: 0.1) {
2525
progress(0.0)
2626
progress(1.0)
2727

@@ -32,6 +32,7 @@ class BasicTests: _TestCase
3232
reject("ERROR")
3333
}
3434
}
35+
return
3536

3637
}
3738

SwiftTaskTests/RetainCycleTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class RetainCycleTests: _TestCase
4747
weak var task: Task?
4848
weak var player: Player?
4949

50-
func _testPlayer_completionAsArgument_notConfigured()
50+
func testPlayer_completionAsArgument_notConfigured()
5151
{
5252
var expect = self.expectationWithDescription(__FUNCTION__)
5353

@@ -93,7 +93,7 @@ class RetainCycleTests: _TestCase
9393
}
9494
}
9595

96-
func _testPlayer_completionAsArgument_configured()
96+
func testPlayer_completionAsArgument_configured()
9797
{
9898
var expect = self.expectationWithDescription(__FUNCTION__)
9999

@@ -141,7 +141,7 @@ class RetainCycleTests: _TestCase
141141
}
142142
}
143143

144-
func _testPlayer_completionAsStoredProperty_notConfigured()
144+
func testPlayer_completionAsStoredProperty_notConfigured()
145145
{
146146
var expect = self.expectationWithDescription(__FUNCTION__)
147147

0 commit comments

Comments
 (0)