mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
28 lines
788 B
Swift
28 lines
788 B
Swift
import XCTest
|
|
#if USING_SQLCIPHER
|
|
import GRDBCipher
|
|
#elseif USING_CUSTOMSQLITE
|
|
import GRDBCustomSQLite
|
|
#else
|
|
import GRDB
|
|
#endif
|
|
|
|
class IteratorCursorTests: GRDBTestCase {
|
|
|
|
func testIteratorCursorFromIterator() {
|
|
let cursor = IteratorCursor([0, 1].makeIterator())
|
|
XCTAssertEqual(cursor.next()!, 0)
|
|
XCTAssertEqual(cursor.next()!, 1)
|
|
XCTAssertTrue(cursor.next() == nil) // end
|
|
XCTAssertTrue(cursor.next() == nil) // past the end
|
|
}
|
|
|
|
func testIteratorCursorFromSequence() {
|
|
let cursor = IteratorCursor([0, 1])
|
|
XCTAssertEqual(cursor.next()!, 0)
|
|
XCTAssertEqual(cursor.next()!, 1)
|
|
XCTAssertTrue(cursor.next() == nil) // end
|
|
XCTAssertTrue(cursor.next() == nil) // past the end
|
|
}
|
|
}
|