New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] Single + Maybe + Completeable #1123

Merged
merged 10 commits into from Mar 12, 2017

Adds `PrimitiveSequence` unit tests.

  • Loading branch information...
kzaher committed Mar 12, 2017
commit 23ab91beb493a70aa59f2eb50c8acaee2657a1d6
@@ -547,6 +547,9 @@
C84CC5681BDD08A500E06A64 /* SubscriptionDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84CC5661BDD08A500E06A64 /* SubscriptionDisposable.swift */; };
C84CC5691BDD08A500E06A64 /* SubscriptionDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84CC5661BDD08A500E06A64 /* SubscriptionDisposable.swift */; };
C84CC56A1BDD08A500E06A64 /* SubscriptionDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84CC5661BDD08A500E06A64 /* SubscriptionDisposable.swift */; };
C850F3D41E749F5C006C417C /* Single+Maybe+Completeable+Test.swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = C850F3D31E749F5C006C417C /* Single+Maybe+Completeable+Test.swift.swift */; };
C850F3D51E749F5C006C417C /* Single+Maybe+Completeable+Test.swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = C850F3D31E749F5C006C417C /* Single+Maybe+Completeable+Test.swift.swift */; };
C850F3D61E749F5C006C417C /* Single+Maybe+Completeable+Test.swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = C850F3D31E749F5C006C417C /* Single+Maybe+Completeable+Test.swift.swift */; };
C85106881C2D550E0075150C /* String+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85106871C2D550E0075150C /* String+Rx.swift */; };
C85106891C2D550E0075150C /* String+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85106871C2D550E0075150C /* String+Rx.swift */; };
C851068A1C2D550E0075150C /* String+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85106871C2D550E0075150C /* String+Rx.swift */; };
@@ -1787,6 +1790,7 @@
C84CC55C1BDD010800E06A64 /* SynchronizedUnsubscribeType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SynchronizedUnsubscribeType.swift; sourceTree = "<group>"; };
C84CC5611BDD037900E06A64 /* SynchronizedDisposeType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SynchronizedDisposeType.swift; sourceTree = "<group>"; };
C84CC5661BDD08A500E06A64 /* SubscriptionDisposable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubscriptionDisposable.swift; sourceTree = "<group>"; };
C850F3D31E749F5C006C417C /* Single+Maybe+Completeable+Test.swift.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Single+Maybe+Completeable+Test.swift.swift"; sourceTree = "<group>"; };
C85106871C2D550E0075150C /* String+Rx.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Rx.swift"; sourceTree = "<group>"; };
C85217E31E3374710015DD38 /* GroupBy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GroupBy.swift; sourceTree = "<group>"; };
C85217E81E3374970015DD38 /* GroupedObservable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GroupedObservable.swift; sourceTree = "<group>"; };
@@ -2564,6 +2568,7 @@
C8BAA78C1E34F8D400EEC727 /* RecursiveLockTest.swift */,
C896A68A1E6B7DC60073A3A8 /* Observable+MultipleTest+CombineLatest+Fixed.swift */,
C81A097C1E6C27A100900B3B /* Observable+MultipleTest+Zip+Fixed.swift */,
C850F3D31E749F5C006C417C /* Single+Maybe+Completeable+Test.swift.swift */,
);
path = RxSwiftTests;
sourceTree = "<group>";
@@ -4067,6 +4072,7 @@
C81A097D1E6C27A100900B3B /* Observable+MultipleTest+Zip+Fixed.swift in Sources */,
C83509321C38706E0027C24C /* DelegateProxyTest.swift in Sources */,
0BA9496C1E224B9C0036DD06 /* AsyncSubjectTests.swift in Sources */,
C850F3D41E749F5C006C417C /* Single+Maybe+Completeable+Test.swift.swift in Sources */,
C8F27DC01CE68DA600D5FB4F /* UITextView+RxTests.swift in Sources */,
C860EC951C42E25E00A664B3 /* SectionedViewDataSourceMock.swift in Sources */,
C83509431C38706E0027C24C /* MockDisposable.swift in Sources */,
@@ -4173,6 +4179,7 @@
C81B6AAE1DB2C15C0047CF86 /* Platform.Linux.swift in Sources */,
C83509F21C38755D0027C24C /* AnonymousObservable+Test.swift in Sources */,
7FE849481C5D0D6B00845C0E /* UIRefreshControl+RxTests.swift in Sources */,
C850F3D51E749F5C006C417C /* Single+Maybe+Completeable+Test.swift.swift in Sources */,
C8C4F1791DE9DF0200003FA7 /* UIAlertAction+RxTests.swift in Sources */,
C83509D31C3875390027C24C /* RXObjCRuntime+Testing.m in Sources */,
C81A097E1E6C27A100900B3B /* Observable+MultipleTest+Zip+Fixed.swift in Sources */,
@@ -4201,6 +4208,7 @@
C8D9D6171E63747200AFCA6C /* Observable+MultipleTest2.swift in Sources */,
0BA9496E1E224B9C0036DD06 /* AsyncSubjectTests.swift in Sources */,
C83509E71C3875580027C24C /* PrimitiveHotObservable.swift in Sources */,
C850F3D61E749F5C006C417C /* Single+Maybe+Completeable+Test.swift.swift in Sources */,
C83509CE1C3875230027C24C /* NSObject+RxTests.swift in Sources */,
C8350A011C38755E0027C24C /* AssumptionsTest.swift in Sources */,
C81B6AAC1DB2C15C0047CF86 /* Platform.Darwin.swift in Sources */,
@@ -507,4 +507,32 @@ extension PrimitiveSequenceType where ElementType: SignedInteger
}
}
extension PrimitiveSequenceType where TraitType == MaybeTrait {
/**
Returns an empty observable sequence, using the specified scheduler to send out the single `Completed` message.
- seealso: [empty operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html)
- returns: An observable sequence with no elements.
*/
public static func empty() -> PrimitiveSequence<MaybeTrait, ElementType> {
return PrimitiveSequence(raw: Observable.empty())
}
}
extension PrimitiveSequenceType where TraitType == CompleteableTrait, ElementType == Never {
/**
Returns an empty observable sequence, using the specified scheduler to send out the single `Completed` message.
- seealso: [empty operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html)
- returns: An observable sequence with no elements.
*/
public static func empty() -> PrimitiveSequence<CompleteableTrait, Never> {
return PrimitiveSequence(raw: Observable.empty())
}
}
// Zip: To be done
@@ -54,6 +54,51 @@ final class AnomaliesTest_ : AnomaliesTest, RxTestCase {
] }
}
final class PrimitiveSequenceTest_ : PrimitiveSequenceTest, RxTestCase {
#if os(macOS)
required override init() {
super.init()
}
#endif
static var allTests: [(String, (PrimitiveSequenceTest_) -> () -> ())] { return [
("testSingle_Subscription_success", PrimitiveSequenceTest.testSingle_Subscription_success),
("testSingle_Subscription_error", PrimitiveSequenceTest.testSingle_Subscription_error),
("testSingle_create_success", PrimitiveSequenceTest.testSingle_create_success),
("testSingle_create_error", PrimitiveSequenceTest.testSingle_create_error),
("testSingle_create_disposing", PrimitiveSequenceTest.testSingle_create_disposing),
("testMaybe_Subscription_success", PrimitiveSequenceTest.testMaybe_Subscription_success),
("testMaybe_Subscription_completed", PrimitiveSequenceTest.testMaybe_Subscription_completed),
("testMaybe_Subscription_error", PrimitiveSequenceTest.testMaybe_Subscription_error),
("testMaybe_create_success", PrimitiveSequenceTest.testMaybe_create_success),
("testMaybe_create_completed", PrimitiveSequenceTest.testMaybe_create_completed),
("testMaybe_create_error", PrimitiveSequenceTest.testMaybe_create_error),
("testMaybe_create_disposing", PrimitiveSequenceTest.testMaybe_create_disposing),
("testCompleteable_Subscription_completed", PrimitiveSequenceTest.testCompleteable_Subscription_completed),
("testCompleteable_Subscription_error", PrimitiveSequenceTest.testCompleteable_Subscription_error),
("testCompleteable_create_completed", PrimitiveSequenceTest.testCompleteable_create_completed),
("testCompleteable_create_error", PrimitiveSequenceTest.testCompleteable_create_error),
("testCompleteable_create_disposing", PrimitiveSequenceTest.testCompleteable_create_disposing),
("testSingle_deferred_producesSingleElement", PrimitiveSequenceTest.testSingle_deferred_producesSingleElement),
("testSingle_just_producesSingleElement", PrimitiveSequenceTest.testSingle_just_producesSingleElement),
("testSingle_just2_producesSingleElement", PrimitiveSequenceTest.testSingle_just2_producesSingleElement),
("testSingle_error_fails", PrimitiveSequenceTest.testSingle_error_fails),
("testSingle_never_producesSingleElement", PrimitiveSequenceTest.testSingle_never_producesSingleElement),
("testSingle_delaySubscription_producesSingleElement", PrimitiveSequenceTest.testSingle_delaySubscription_producesSingleElement),
("testSingle_delay_producesSingleElement", PrimitiveSequenceTest.testSingle_delay_producesSingleElement),
("testSingle_do_producesSingleElement", PrimitiveSequenceTest.testSingle_do_producesSingleElement),
("testSingle_filter_resultIsMaybe", PrimitiveSequenceTest.testSingle_filter_resultIsMaybe),
("testSingle_map_producesSingleElement", PrimitiveSequenceTest.testSingle_map_producesSingleElement),
("testSingle_flatMap_producesSingleElement", PrimitiveSequenceTest.testSingle_flatMap_producesSingleElement),
("testSingle_observeOn_producesSingleElement", PrimitiveSequenceTest.testSingle_observeOn_producesSingleElement),
("testSingle_catchError_producesSingleElement", PrimitiveSequenceTest.testSingle_catchError_producesSingleElement),
("testSingle_retry_producesSingleElement", PrimitiveSequenceTest.testSingle_retry_producesSingleElement),
("testSingle_retryWhen1_producesSingleElement", PrimitiveSequenceTest.testSingle_retryWhen1_producesSingleElement),
("testSingle_retryWhen2_producesSingleElement", PrimitiveSequenceTest.testSingle_retryWhen2_producesSingleElement),
("testSingle_timer_producesSingleElement", PrimitiveSequenceTest.testSingle_timer_producesSingleElement),
] }
}
final class VirtualSchedulerTest_ : VirtualSchedulerTest, RxTestCase {
#if os(macOS)
required override init() {
@@ -1195,6 +1240,7 @@ func XCTMain(_ tests: [() -> ()]) {
testCase(EventTests_.allTests),
testCase(PublishSubjectTest_.allTests),
testCase(AnomaliesTest_.allTests),
testCase(PrimitiveSequenceTest_.allTests),
testCase(VirtualSchedulerTest_.allTests),
testCase(ObservableBlockingTest_.allTests),
testCase(ObservableTimeTest_.allTests),
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.