mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
Tests for Cursor.reduce(into:_:)
This commit is contained in:
1 parent
e4b83baa53
commit
7ca582719b
1 file changed
+6
@@ -126,6 +126,12 @@ class CursorTests: GRDBTestCase {
|
||||
XCTAssertEqual(squareSum, 5)
|
||||
}
|
||||
|
||||
func testReduceInto() throws {
|
||||
let cursor = IteratorCursor([1, 2])
|
||||
let squareSum = try cursor.reduce(into: 0) { (acc, int) in acc += int * int }
|
||||
XCTAssertEqual(squareSum, 5)
|
||||
}
|
||||
|
||||
func testSuffix() throws {
|
||||
do {
|
||||
let cursor = IteratorCursor([1, 2, 3, 4, 5])
|
||||
|
||||
Reference in new issue
Block a user