Tests for Cursor.dropLast(_:)

This commit is contained in:
Gwendal Roué committed 2018-01-28 17:13:48 +01:00
1 parent 520bdd64e6
commit dccd456497
1 file changed
+6
+6
View File
@@ -28,6 +28,12 @@ class CursorTests: GRDBTestCase {
}
}
func testDropLast() {
XCTAssertTrue(try IteratorCursor([1, 2, 3, 4, 5]).dropLast(0) == [1, 2, 3, 4, 5])
XCTAssertTrue(try IteratorCursor([1, 2, 3, 4, 5]).dropLast(2) == [1, 2, 3])
XCTAssertTrue(try IteratorCursor([1, 2, 3, 4, 5]).dropLast(10) == [])
}
func testContainsIsLazy() {
func makeCursor() -> AnyCursor<Int> {
var i = 0