Skip to content

Commit a829d1c

Browse files
authored
Merge pull request #643 from ReactiveCocoa/anders/fix-typo
Rewrite names of a few test case. Disable four test cases.
2 parents 7c25bc2 + d4b94a3 commit a829d1c

File tree

6 files changed

+58
-34
lines changed

6 files changed

+58
-34
lines changed

Sources/Flatten.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ extension SignalProducer {
436436
/// - previous: A producer to start before `self`.
437437
///
438438
/// - returns: A signal producer that, when started, first emits values from
439-
/// `previous` producer and then from `self`.
439+
/// `previous` producer and then from `self`.
440440
public func prefix<Previous: SignalProducerConvertible>(_ previous: Previous) -> SignalProducer<Value, Error> where Previous.Value == Value, Previous.Error == Error {
441441
return prefix(previous.producer)
442442
}

Tests/ReactiveSwiftTests/FlattenSpec.swift

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -645,22 +645,34 @@ class FlattenSpec: QuickSpec {
645645
.flatMap(.latest) { _ in Property(value: 0) }
646646
}
647647

648-
it("sould available to use contextual lookup for flatMap arbitrary error signal to arbitrary error signal") {
648+
it("should be able to fallback to SignalProducer for contextual lookups with explicit inner value and error type parameters, given an upstream of arbitrary error type") {
649649
_ = Signal<Int, TestError>.empty
650650
.flatMap(.latest) { _ in .init(result: Result<Int, TestError>(error: .default)) }
651651
}
652652

653-
it("sould available to use contextual lookup for flatMap NoError signal to NoError signal") {
653+
it("should be able to fallback to SignalProducer for contextual lookups with implicit error type parameter") {
654654
_ = Signal<Int, NoError>.empty
655655
.flatMap(.latest) { _ in .init(value: 0) }
656656
}
657657

658-
it("sould available to use contextual lookup for flatMap arbitrary error signal and NoError signal") {
658+
it("should be able to fallback to SignalProducer for contextual lookups with implicit error type parameter") {
659659
_ = Signal<Int, TestError>.empty
660660
.flatMap(.latest) { _ in .init(value: 0) }
661661
}
662662

663-
it("sould available to use contextual lookup for flatMap NoError signal to arbitrary error signal") {
663+
// NOTE: These test cases were disabled as the Swift 4.2 type checker apparently
664+
// cannot infer the type paramaters when both are absent.
665+
// it("should be able to fallback to SignalProducer for contextual lookups without explicit inner value and error type parameters") {
666+
// _ = Signal<Int, NoError>.empty
667+
// .flatMap(.latest) { _ in .empty }
668+
// }
669+
//
670+
// it("should be able to fallback to SignalProducer for contextual lookups without explicit inner value and error type parameters") {
671+
// _ = Signal<Int, TestError>.empty
672+
// .flatMap(.latest) { _ in .empty }
673+
// }
674+
675+
it("should be able to fallback to SignalProducer for contextual lookups with explicit inner and error type parameters, given a NoError upstream") {
664676
_ = Signal<Int, NoError>.empty
665677
.flatMap(.latest) { _ in .init(result: Result<Int, TestError>(error: .default)) }
666678
}
@@ -835,22 +847,34 @@ class FlattenSpec: QuickSpec {
835847
.flatMap(.latest) { _ in Property(value: 0) }
836848
}
837849

838-
it("sould available to use contextual lookup for flatMap arbitrary error signal to arbitrary error signal") {
850+
it("should be able to fallback to SignalProducer for contextual lookups with explicit inner value and error type parameters, given an upstream of arbitrary error type") {
839851
_ = SignalProducer<Int, TestError>.empty
840852
.flatMap(.latest) { _ in .init(error: .default) } as SignalProducer<Int, TestError>
841853
}
842854

843-
it("sould available to use contextual lookup for flatMap NoError signal to NoError signal") {
855+
it("should be able to fallback to SignalProducer for contextual lookups with implicit inner error type parameter") {
844856
_ = SignalProducer<Int, NoError>.empty
845857
.flatMap(.latest) { _ in .init(value: 0) }
846858
}
847859

848-
it("sould available to use contextual lookup for flatMap arbitrary error signal to NoError signal") {
860+
it("should be able to fallback to SignalProducer for contextual lookups with implicit inner error type parameter") {
849861
_ = SignalProducer<Int, TestError>.empty
850862
.flatMap(.latest) { _ in .init(value: 0) }
851863
}
852864

853-
it("sould available to use contextual lookup for flatMap NoError signal to arbitrary error signal") {
865+
// NOTE: These test cases were disabled as the Swift 4.2 type checker apparently
866+
// cannot infer the type paramaters when both are absent.
867+
// it("should be able to fallback to SignalProducer for contextual lookups without explicit inner value and error type parameters") {
868+
// _ = SignalProducer<Int, NoError>.empty
869+
// .flatMap(.latest) { _ in .empty }
870+
// }
871+
//
872+
// it("should be able to fallback to SignalProducer for contextual lookups without explicit inner value and error type parameters") {
873+
// _ = SignalProducer<Int, TestError>.empty
874+
// .flatMap(.latest) { _ in .empty }
875+
// }
876+
877+
it("should be able to fallback to SignalProducer for contextual lookups with explicit inner and error type parameters, given a NoError upstream.") {
854878
_ = SignalProducer<Int, NoError>.empty
855879
.flatMap(.latest) { _ in .init(error: .default) } as SignalProducer<Int, TestError>
856880
}
@@ -1139,7 +1163,7 @@ class FlattenSpec: QuickSpec {
11391163
expect(completed) == true
11401164
}
11411165

1142-
it("sould available to use contextual lookup") {
1166+
it("should be able to fallback to SignalProducer for contextual lookups") {
11431167
_ = SignalProducer<Int, NoError>.empty
11441168
.merge(with: .init(value: 0))
11451169
}
@@ -1206,7 +1230,7 @@ class FlattenSpec: QuickSpec {
12061230
expect(lastValue) == 3
12071231
}
12081232

1209-
it("sould available to use contextual lookup") {
1233+
it("should be able to fallback to SignalProducer for contextual lookups") {
12101234
_ = SignalProducer<Int, NoError>.empty
12111235
.prefix(.init(value: 0))
12121236
}
@@ -1310,7 +1334,7 @@ class FlattenSpec: QuickSpec {
13101334
expect(results[0].error) == .error1
13111335
}
13121336

1313-
it("sould available to use contextual lookup") {
1337+
it("should be able to fallback to SignalProducer for contextual lookups") {
13141338
_ = SignalProducer<Int, NoError>.empty
13151339
.concat(.init(value: 0))
13161340
}

Tests/ReactiveSwiftTests/PropertySpec.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,11 +662,11 @@ class PropertySpec: QuickSpec {
662662
expect(signalInterrupted) == true
663663
}
664664

665-
it("sould available to use contextual lookup") {
665+
it("should be able to fallback to SignalProducer for contextual lookups") {
666666
_ = Property(initial: 0, then: .init(value: 0))
667667
}
668668

669-
it("sould available to use contextual lookup for optional value") {
669+
it("should be able to fallback to SignalProducer for contextual lookups when an optional value type parameter is involved") {
670670
_ = Property(initial: Optional(0), then: .init(value: 0))
671671
}
672672
}

Tests/ReactiveSwiftTests/SignalProducerLiftingSpec.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ class SignalProducerLiftingSpec: QuickSpec {
723723
expect(lastValue) == 0
724724
}
725725

726-
it("sould available to use contextual lookup") {
726+
it("should be able to fallback to SignalProducer for contextual lookups") {
727727
_ = SignalProducer<Int, NoError>.empty
728728
.skip(until: .init(value: ()))
729729
}
@@ -1023,7 +1023,7 @@ class SignalProducerLiftingSpec: QuickSpec {
10231023
expect(lastValue).to(beNil())
10241024
}
10251025

1026-
it("sould available to use contextual lookup") {
1026+
it("should be able to fallback to SignalProducer for contextual lookups") {
10271027
_ = SignalProducer<Int, NoError>.empty
10281028
.take(until: .init(value: ()))
10291029
}
@@ -1088,7 +1088,7 @@ class SignalProducerLiftingSpec: QuickSpec {
10881088
expect(completed) == true
10891089
}
10901090

1091-
it("sould available to use contextual lookup") {
1091+
it("should be able to fallback to SignalProducer for contextual lookups") {
10921092
_ = SignalProducer<Int, NoError>.empty
10931093
.take(untilReplacement: .init(value: 0))
10941094
}
@@ -1434,7 +1434,7 @@ class SignalProducerLiftingSpec: QuickSpec {
14341434
expect(valueReceived) == "1a"
14351435
}
14361436

1437-
it("sould available to use contextual lookup") {
1437+
it("should be able to fallback to SignalProducer for contextual lookups") {
14381438
_ = SignalProducer<Int, NoError>.empty
14391439
.sample(with: .init(value: 0))
14401440
}
@@ -1547,7 +1547,7 @@ class SignalProducerLiftingSpec: QuickSpec {
15471547
}
15481548
}
15491549

1550-
it("sould available to use contextual lookup") {
1550+
it("should be able to fallback to SignalProducer for contextual lookups") {
15511551
_ = SignalProducer<Int, NoError>.empty
15521552
.sample(on: .init(value: ()))
15531553
}
@@ -1684,7 +1684,7 @@ class SignalProducerLiftingSpec: QuickSpec {
16841684
expect(event).to(beNil())
16851685
}
16861686

1687-
it("sould available to use contextual lookup") {
1687+
it("should be able to fallback to SignalProducer for contextual lookups") {
16881688
_ = SignalProducer<Int, NoError>.empty
16891689
.withLatest(from: .init(value: 0))
16901690
}
@@ -1731,7 +1731,7 @@ class SignalProducerLiftingSpec: QuickSpec {
17311731
expect(completed) == true
17321732
}
17331733

1734-
it("sould available to use contextual lookup") {
1734+
it("should be able to fallback to SignalProducer for contextual lookups") {
17351735
_ = SignalProducer<Int, NoError>.empty
17361736
.combineLatest(with: .init(value: 0))
17371737
}
@@ -1803,7 +1803,7 @@ class SignalProducerLiftingSpec: QuickSpec {
18031803
expect(result) == [ "0foo" ]
18041804
}
18051805

1806-
it("sould available to use contextual lookup") {
1806+
it("should be able to fallback to SignalProducer for contextual lookups") {
18071807
_ = SignalProducer<Int, NoError>.empty
18081808
.zip(with: .init(value: 0))
18091809
}

Tests/ReactiveSwiftTests/SignalProducerSpec.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ class SignalProducerSpec: QuickSpec {
13111311
expect(disposed) == true
13121312
}
13131313

1314-
it("sould available to use contextual lookup") {
1314+
it("should be able to fallback to SignalProducer for contextual lookups") {
13151315
_ = SignalProducer<Int, TestError>.empty
13161316
.flatMapError { _ in .init(value: 0) }
13171317
}
@@ -2317,32 +2317,32 @@ class SignalProducerSpec: QuickSpec {
23172317
expect(type(of: h)) == SignalProducer<Double, TestError>.self
23182318
}
23192319

2320-
it("sould available to use contextual lookup for arbitrary error signal then same value same error signal") {
2320+
it("should be able to fallback to SignalProducer for contextual lookups without explicit value and error type parameters, given an upstream of arbitrary error type") {
23212321
_ = SignalProducer<Int, TestError>.empty
2322-
.then(.init(value: 0))
2322+
.then(.empty)
23232323
}
23242324

2325-
it("sould available to use contextual lookup for arbitrary error signal then other value same error signal") {
2325+
it("should be able to fallback to SignalProducer for contextual lookups with explicit value and error type parameters, given an upstream of arbitary error type") {
23262326
_ = SignalProducer<Int, TestError>.empty
23272327
.then(.init(result: Result<String, TestError>(value: "")))
23282328
}
23292329

2330-
it("sould available to use contextual lookup for arbitrary error signal then other value NoError signal") {
2330+
it("should be able to fallback to SignalProducer for contextual lookups without explicit error type parameter") {
23312331
_ = SignalProducer<Int, TestError>.empty
23322332
.then(.init(value: ""))
23332333
}
23342334

2335-
it("sould available to use contextual lookup for NoError signal then same value same error signal") {
2335+
it("should be able to fallback to SignalProducer for contextual lookups without explicit value and error type parameters, given a NoError upstream") {
23362336
_ = SignalProducer<Int, NoError>.empty
2337-
.then(.init(value: 0))
2337+
.then(.empty)
23382338
}
23392339

2340-
it("sould available to use contextual lookup for NoError signal then other value same error signal") {
2340+
it("should be able to fallback to SignalProducer for contextual lookups without explicit error type parameter") {
23412341
_ = SignalProducer<Int, NoError>.empty
23422342
.then(.init(value: ""))
23432343
}
23442344

2345-
it("sould available to use contextual lookup for NoError signal then other value arbitrary error signal") {
2345+
it("should be able to fallback to SignalProducer for contextual lookups with explicit value and error type parameters, given a NoError upstream") {
23462346
_ = SignalProducer<Int, NoError>.empty
23472347
.then(.init(result: Result<String, TestError>(value: "")))
23482348
}
@@ -2994,7 +2994,7 @@ class SignalProducerSpec: QuickSpec {
29942994
observer2.sendCompleted()
29952995
}
29962996

2997-
it("sould available to use contextual lookup") {
2997+
it("should be able to fallback to SignalProducer for contextual lookups") {
29982998
_ = SignalProducer<Bool, NoError>.empty
29992999
.and(.init(value: true))
30003000
}
@@ -3045,7 +3045,7 @@ class SignalProducerSpec: QuickSpec {
30453045
observer2.sendCompleted()
30463046
}
30473047

3048-
it("sould available to use contextual lookup") {
3048+
it("should be able to fallback to SignalProducer for contextual lookups") {
30493049
_ = SignalProducer<Bool, NoError>.empty
30503050
.or(.init(value: true))
30513051
}

Tests/ReactiveSwiftTests/SignalSpec.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2685,7 +2685,7 @@ class SignalSpec: QuickSpec {
26852685
expect(event).to(beNil())
26862686
}
26872687

2688-
it("sould available to use contextual lookup") {
2688+
it("should be able to fallback to SignalProducer for contextual lookups") {
26892689
_ = Signal<Int, NoError>.empty
26902690
.withLatest(from: .init(value: 0))
26912691
}

0 commit comments

Comments
 (0)