mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
Tests for Cursor.dropFirst(_:)
This commit is contained in:
1 parent
1e5caa62a8
commit
129e178ee0
1 file changed
+11
@@ -12,6 +12,17 @@ private struct TestError : Error { }
|
||||
class DropFirstCursorTests: GRDBTestCase {
|
||||
|
||||
func testDropFirstCursorFromCursor() throws {
|
||||
do {
|
||||
let base = IteratorCursor([1, 2, 3, 4, 5])
|
||||
let cursor = base.dropFirst(0)
|
||||
try XCTAssertEqual(cursor.next()!, 1)
|
||||
try XCTAssertEqual(cursor.next()!, 2)
|
||||
try XCTAssertEqual(cursor.next()!, 3)
|
||||
try XCTAssertEqual(cursor.next()!, 4)
|
||||
try XCTAssertEqual(cursor.next()!, 5)
|
||||
XCTAssertTrue(try cursor.next() == nil) // end
|
||||
XCTAssertTrue(try cursor.next() == nil) // past the end
|
||||
}
|
||||
do {
|
||||
let base = IteratorCursor([1, 2, 3, 4, 5])
|
||||
let cursor = base.dropFirst(2)
|
||||
|
||||
Reference in new issue
Block a user