1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-01 01:32:04 +03:00
vimr/VimR/VimRTests/RxSwiftCommonsTest.swift
Tae Won Ha 025c134f88
Rename
2019-03-09 17:58:46 +01:00

40 lines
717 B
Swift

/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import XCTest
import Nimble
import RxSwift
import RxTest
class RxSwiftCommonsTest: XCTestCase {
func testMapOmittingNil() {
let scheduler = TestScheduler(initialClock: 0)
let xs = scheduler.createHotObservable(
[
next(150, 1),
next(210, 2),
next(220, 3),
next(230, 4),
next(240, 5),
next(260, 6),
completed(300)
]
)
let res = scheduler.start { xs.compactMap { $0 % 2 == 0 ? $0 : nil } }
let correctMessages = [
next(210, 2),
next(230, 4),
next(260, 6),
completed(300)
]
XCTAssertEqual(res.events, correctMessages)
}
}