Skip to content

Commit d3c3b02

Browse files
authored
Merge pull request #437 from ReactiveCocoa/expanded-ci-builds
Expanded CI builds
2 parents 86d9f62 + 7fc5d66 commit d3c3b02

File tree

8 files changed

+95
-56
lines changed

8 files changed

+95
-56
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
env:
5050
- JOB=PODSPEC
5151
- script:
52+
- swift --version
5253
- swift build
5354
- SWIFTPM_TEST_ReactiveSwift=YES swift test
5455
git:
@@ -58,19 +59,22 @@ jobs:
5859
- before_install:
5960
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
6061
script:
62+
- swift --version
6163
- swift build
64+
- SWIFTPM_TEST_ReactiveSwift=YES swift test
6265
git:
6366
submodules: false
6467
env:
6568
- JOB=SWIFT_4
66-
- SWIFT_VERSION=DEVELOPMENT-SNAPSHOT-2017-05-29-a
69+
- SWIFT_VERSION=4.0-DEVELOPMENT-SNAPSHOT-2017-06-06-a
6770
- os: linux
6871
language: generic
6972
sudo: required
7073
dist: trusty
7174
before_install:
7275
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
7376
script:
77+
- swift --version
7478
- swift build
7579
- SWIFTPM_TEST_ReactiveSwift=YES swift test
7680
git:

Package.resolved

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ let package = Package(
1818
]
1919
}
2020
return deps
21-
}()
21+
}(),
22+
swiftLanguageVersions: [3, 4]
2223
)

Tests/ReactiveSwiftTests/ActionSpec.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ class ActionSpec: QuickSpec {
5656

5757
action.values.observeValues { values.append($0) }
5858
action.errors.observeValues { errors.append($0) }
59-
action.completed.observeValues { completedCount += 1 }
59+
action.completed.observeValues { _ in completedCount += 1 }
6060
}
6161

6262
it("should retain the state property") {
6363
var property: MutableProperty<Bool>? = MutableProperty(false)
6464
weak var weakProperty = property
6565

66-
var action: Action<(), (), NoError>? = Action(state: property!, enabledIf: { _ in true }) { _ in
66+
var action: Action<(), (), NoError>? = Action(state: property!, enabledIf: { _ in true }) { _, _ in
6767
return .empty
6868
}
6969

@@ -88,7 +88,7 @@ class ActionSpec: QuickSpec {
8888
var receivedError: ActionError<NSError>?
8989
var disabledErrorsTriggered = false
9090

91-
action.disabledErrors.observeValues {
91+
action.disabledErrors.observeValues { _ in
9292
disabledErrorsTriggered = true
9393
}
9494

@@ -133,10 +133,10 @@ class ActionSpec: QuickSpec {
133133

134134
it("should not deadlock") {
135135
final class ViewModel {
136-
let action2 = Action<(), (), NoError> { SignalProducer(value: ()) }
136+
let action2 = Action<(), (), NoError> { _ in SignalProducer(value: ()) }
137137
}
138138

139-
let action1 = Action<(), ViewModel, NoError> { SignalProducer(value: ViewModel()) }
139+
let action1 = Action<(), ViewModel, NoError> { _ in SignalProducer(value: ViewModel()) }
140140

141141
// Fixed in #267. (https://github.com/ReactiveCocoa/ReactiveSwift/pull/267)
142142
//
@@ -150,15 +150,15 @@ class ActionSpec: QuickSpec {
150150
.flatMap(.latest) { viewModel in viewModel.action2.values.map { _ in viewModel } }
151151
.observeValues { _ in }
152152

153-
action1.apply().start()
154-
action1.apply().start()
153+
action1.apply(()).start()
154+
action1.apply(()).start()
155155
}
156156

157157
if #available(macOS 10.10, *) {
158158
it("should not loop indefinitely") {
159159
let condition = MutableProperty(1)
160160

161-
let action = Action<Void, Void, NoError>(state: condition, enabledIf: { $0 == 0 }) { _ in
161+
let action = Action<Void, Void, NoError>(state: condition, enabledIf: { $0 == 0 }) { _, _ in
162162
return .empty
163163
}
164164

@@ -314,11 +314,11 @@ class ActionSpec: QuickSpec {
314314
action.values.observeValues { values.append($0) }
315315

316316
input.value = 1
317-
action.apply().start()
317+
action.apply(()).start()
318318
input.value = 2
319-
action.apply().start()
319+
action.apply(()).start()
320320
input.value = 3
321-
action.apply().start()
321+
action.apply(()).start()
322322

323323
expect(values) == [1, 2, 3]
324324
}

Tests/ReactiveSwiftTests/PropertySpec.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ class PropertySpec: QuickSpec {
783783
var secondResult: String!
784784

785785
let combined = property.combineLatest(with: otherProperty)
786-
combined.producer.startWithValues { (left, right) in firstResult = left + right }
786+
combined.producer.startWithValues { firstResult = $0.0 + $0.1 }
787787

788788
func getValue() -> String {
789789
return combined.value.0 + combined.value.1
@@ -796,7 +796,7 @@ class PropertySpec: QuickSpec {
796796
expect(getValue()) == subsequentPropertyValue + initialOtherPropertyValue
797797
expect(firstResult) == subsequentPropertyValue + initialOtherPropertyValue
798798

799-
combined.producer.startWithValues { (left, right) in secondResult = left + right }
799+
combined.producer.startWithValues { secondResult = $0.0 + $0.1 }
800800
expect(secondResult) == subsequentPropertyValue + initialOtherPropertyValue
801801

802802
otherProperty.value = subsequentOtherPropertyValue
@@ -813,7 +813,7 @@ class PropertySpec: QuickSpec {
813813
var firstResult: Int!
814814

815815
let combined = A.combineLatest(with: B)
816-
combined.producer.startWithValues { (left, right) in firstResult = left + right }
816+
combined.producer.startWithValues { firstResult = $0.0 + $0.1 }
817817

818818
func getValue() -> Int {
819819
return combined.value.0 + combined.value.1
@@ -839,7 +839,7 @@ class PropertySpec: QuickSpec {
839839
/// Zip another property now.
840840
var secondResult: Int!
841841
let anotherCombined = combined.combineLatest(with: C)
842-
anotherCombined.producer.startWithValues { (left, right) in secondResult = (left.0 + left.1) + right }
842+
anotherCombined.producer.startWithValues { secondResult = ($0.0.0 + $0.0.1) + $0.1 }
843843

844844
func getAnotherValue() -> Int {
845845
return (anotherCombined.value.0.0 + anotherCombined.value.0.1) + anotherCombined.value.1
@@ -866,7 +866,7 @@ class PropertySpec: QuickSpec {
866866
var result: [String] = []
867867

868868
let zippedProperty = property.zip(with: otherProperty)
869-
zippedProperty.producer.startWithValues { (left, right) in result.append("\(left)\(right)") }
869+
zippedProperty.producer.startWithValues { result.append("\($0.0)\($0.1)") }
870870

871871
let firstResult = [ "\(initialPropertyValue)\(initialOtherPropertyValue)" ]
872872
let secondResult = firstResult + [ "\(subsequentPropertyValue)\(subsequentOtherPropertyValue)" ]
@@ -900,7 +900,7 @@ class PropertySpec: QuickSpec {
900900
var secondResult: String!
901901

902902
let zippedProperty = property.zip(with: otherProperty)
903-
zippedProperty.producer.startWithValues { (left, right) in firstResult = left + right }
903+
zippedProperty.producer.startWithValues { firstResult = $0.0 + $0.1 }
904904

905905
func getValue() -> String {
906906
return zippedProperty.value.0 + zippedProperty.value.1
@@ -915,7 +915,7 @@ class PropertySpec: QuickSpec {
915915

916916
// It should still be the tuple with initial property values,
917917
// since `otherProperty` isn't changed yet.
918-
zippedProperty.producer.startWithValues { (left, right) in secondResult = left + right }
918+
zippedProperty.producer.startWithValues { secondResult = $0.0 + $0.1 }
919919
expect(secondResult) == initialPropertyValue + initialOtherPropertyValue
920920

921921
otherProperty.value = subsequentOtherPropertyValue
@@ -932,7 +932,7 @@ class PropertySpec: QuickSpec {
932932
var firstResult: Int!
933933

934934
let zipped = A.zip(with: B)
935-
zipped.producer.startWithValues { (left, right) in firstResult = left + right }
935+
zipped.producer.startWithValues { firstResult = $0.0 + $0.1 }
936936

937937
func getValue() -> Int {
938938
return zipped.value.0 + zipped.value.1
@@ -958,7 +958,7 @@ class PropertySpec: QuickSpec {
958958
/// Zip another property now.
959959
var secondResult: Int!
960960
let anotherZipped = zipped.zip(with: C)
961-
anotherZipped.producer.startWithValues { (left, right) in secondResult = (left.0 + left.1) + right }
961+
anotherZipped.producer.startWithValues { secondResult = ($0.0.0 + $0.0.1) + $0.1 }
962962

963963
func getAnotherValue() -> Int {
964964
return (anotherZipped.value.0.0 + anotherZipped.value.0.1) + anotherZipped.value.1
@@ -987,7 +987,7 @@ class PropertySpec: QuickSpec {
987987
var firstResult: Int!
988988

989989
let zipped = A.zip(with: B)
990-
zipped.producer.startWithValues { (left, right) in firstResult = left + right }
990+
zipped.producer.startWithValues { firstResult = $0.0 + $0.1 }
991991

992992
func getValue() -> Int {
993993
return zipped.value.0 + zipped.value.1
@@ -1013,7 +1013,7 @@ class PropertySpec: QuickSpec {
10131013
/// Zip another property now.
10141014
var secondResult: Int!
10151015
let anotherZipped = zipped.zip(with: C)
1016-
anotherZipped.producer.startWithValues { (left, right) in secondResult = (left.0 + left.1) + right }
1016+
anotherZipped.producer.startWithValues { secondResult = ($0.0.0 + $0.0.1) + $0.1 }
10171017

10181018
func getAnotherValue() -> Int {
10191019
return (anotherZipped.value.0.0 + anotherZipped.value.0.1) + anotherZipped.value.1
@@ -1033,9 +1033,9 @@ class PropertySpec: QuickSpec {
10331033
let combined = anotherZipped.combineLatest(with: yetAnotherZipped)
10341034

10351035
var thirdResult: Int!
1036-
combined.producer.startWithValues { (left, right) in
1037-
let leftResult = left.0.0 + left.0.1 + left.1
1038-
let rightResult = right.0.0.0 + right.0.0.1 + right.0.1 + right.1
1036+
combined.producer.startWithValues {
1037+
let leftResult = $0.0.0.0 + $0.0.0.1 + $0.0.1
1038+
let rightResult = $0.1.0.0.0 + $0.1.0.0.1 + $0.1.0.1 + $0.1.1
10391039
thirdResult = leftResult + rightResult
10401040
}
10411041

Tests/ReactiveSwiftTests/SignalProducerLiftingSpec.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ class SignalProducerLiftingSpec: QuickSpec {
13021302

13031303
it("should forward the latest value when the sampler fires") {
13041304
var result: [String] = []
1305-
sampledProducer.startWithValues { (left, right) in result.append("\(left)\(right)") }
1305+
sampledProducer.startWithValues { result.append("\($0.0)\($0.1)") }
13061306

13071307
observer.send(value: 1)
13081308
observer.send(value: 2)
@@ -1312,15 +1312,15 @@ class SignalProducerLiftingSpec: QuickSpec {
13121312

13131313
it("should do nothing if sampler fires before signal receives value") {
13141314
var result: [String] = []
1315-
sampledProducer.startWithValues { (left, right) in result.append("\(left)\(right)") }
1315+
sampledProducer.startWithValues { result.append("\($0.0)\($0.1)") }
13161316

13171317
samplerObserver.send(value: "a")
13181318
expect(result).to(beEmpty())
13191319
}
13201320

13211321
it("should send lates value multiple times when sampler fires multiple times") {
13221322
var result: [String] = []
1323-
sampledProducer.startWithValues { (left, right) in result.append("\(left)\(right)") }
1323+
sampledProducer.startWithValues { result.append("\($0.0)\($0.1)") }
13241324

13251325
observer.send(value: 1)
13261326
samplerObserver.send(value: "a")
@@ -1346,7 +1346,7 @@ class SignalProducerLiftingSpec: QuickSpec {
13461346
let result = producer.sample(with: sampler)
13471347

13481348
var valueReceived: String?
1349-
result.startWithValues { (left, right) in valueReceived = "\(left)\(right)" }
1349+
result.startWithValues { valueReceived = "\($0.0)\($0.1)" }
13501350

13511351
expect(valueReceived) == "1a"
13521352
}
@@ -1470,7 +1470,7 @@ class SignalProducerLiftingSpec: QuickSpec {
14701470

14711471
it("should forward the latest value when the receiver fires") {
14721472
var result: [String] = []
1473-
withLatestProducer.startWithValues { (left, right) in result.append("\(left)\(right)") }
1473+
withLatestProducer.startWithValues { result.append("\($0.0)\($0.1)") }
14741474

14751475
sampleeObserver.send(value: "a")
14761476
sampleeObserver.send(value: "b")
@@ -1480,15 +1480,15 @@ class SignalProducerLiftingSpec: QuickSpec {
14801480

14811481
it("should do nothing if receiver fires before samplee sends value") {
14821482
var result: [String] = []
1483-
withLatestProducer.startWithValues { (left, right) in result.append("\(left)\(right)") }
1483+
withLatestProducer.startWithValues { result.append("\($0.0)\($0.1)") }
14841484

14851485
observer.send(value: 1)
14861486
expect(result).to(beEmpty())
14871487
}
14881488

14891489
it("should send latest value with samplee value multiple times when receiver fires multiple times") {
14901490
var result: [String] = []
1491-
withLatestProducer.startWithValues { (left, right) in result.append("\(left)\(right)") }
1491+
withLatestProducer.startWithValues { result.append("\($0.0)\($0.1)") }
14921492

14931493
sampleeObserver.send(value: "a")
14941494
observer.send(value: 1)
@@ -1536,7 +1536,7 @@ class SignalProducerLiftingSpec: QuickSpec {
15361536

15371537
it("should forward the latest value when the receiver fires") {
15381538
var result: [String] = []
1539-
withLatestProducer.startWithValues { (left, right) in result.append("\(left)\(right)") }
1539+
withLatestProducer.startWithValues { result.append("\($0.0)\($0.1)") }
15401540

15411541
sampleeObserver.send(value: "a")
15421542
sampleeObserver.send(value: "b")
@@ -1546,15 +1546,15 @@ class SignalProducerLiftingSpec: QuickSpec {
15461546

15471547
it("should do nothing if receiver fires before samplee sends value") {
15481548
var result: [String] = []
1549-
withLatestProducer.startWithValues { (left, right) in result.append("\(left)\(right)") }
1549+
withLatestProducer.startWithValues { result.append("\($0.0)\($0.1)") }
15501550

15511551
observer.send(value: 1)
15521552
expect(result).to(beEmpty())
15531553
}
15541554

15551555
it("should send latest value with samplee value multiple times when receiver fires multiple times") {
15561556
var result: [String] = []
1557-
withLatestProducer.startWithValues { (left, right) in result.append("\(left)\(right)") }
1557+
withLatestProducer.startWithValues { result.append("\($0.0)\($0.1)") }
15581558

15591559
sampleeObserver.send(value: "a")
15601560
observer.send(value: 1)
@@ -1645,7 +1645,7 @@ class SignalProducerLiftingSpec: QuickSpec {
16451645

16461646
it("should combine pairs") {
16471647
var result: [String] = []
1648-
zipped.startWithValues { (left, right) in result.append("\(left)\(right)") }
1648+
zipped.startWithValues { result.append("\($0.0)\($0.1)") }
16491649

16501650
leftObserver.send(value: 1)
16511651
leftObserver.send(value: 2)
@@ -1913,7 +1913,7 @@ class SignalProducerLiftingSpec: QuickSpec {
19131913
it("should forward original values upon success") {
19141914
let (baseProducer, observer) = SignalProducer<Int, TestError>.pipe()
19151915
let producer = baseProducer.attempt { _ in
1916-
return .success()
1916+
return .success(())
19171917
}
19181918

19191919
var current: Int?

0 commit comments

Comments
 (0)