diff --git a/Tests/GRDBTests/DropFirstCursorTests.swift b/Tests/GRDBTests/DropFirstCursorTests.swift index d118418da..96edcdc3d 100644 --- a/Tests/GRDBTests/DropFirstCursorTests.swift +++ b/Tests/GRDBTests/DropFirstCursorTests.swift @@ -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)