More tests for consumption of prefetched rows

This commit is contained in:
Gwendal Roué committed 2019-05-05 17:46:05 +02:00
1 parent 814ed0e4f1
commit f6b2c7e9f3
1 file changed
+5 -4
@@ -999,7 +999,8 @@ class AssociationPrefetchingTests: GRDBTestCase {
.belongsTo(A.self)
.including(all: A
.hasMany(C.self)
.orderByPrimaryKey())
.orderByPrimaryKey()
.forKey("cs")) // TODO: auto-pluralization
)
.orderByPrimaryKey()
@@ -1030,13 +1031,13 @@ class AssociationPrefetchingTests: GRDBTestCase {
XCTAssertEqual(rows.count, 3)
XCTAssertEqual(rows[0].unscoped, ["colb1": 4, "colb2": 1, "colb3": "b1"])
XCTAssertEqual(rows[0].prefetchTree.keys.count, 0)
XCTAssertEqual(rows[0].prefetchTree.keys, ["cs"])
XCTAssertEqual(rows[1].unscoped, ["colb1": 5, "colb2": 1, "colb3": "b2"])
XCTAssertEqual(rows[1].prefetchTree.keys.count, 0)
XCTAssertEqual(rows[1].prefetchTree.keys, ["cs"])
XCTAssertEqual(rows[2].unscoped, ["colb1": 6, "colb2": 2, "colb3": "b3"])
XCTAssertEqual(rows[2].prefetchTree.keys.count, 0)
XCTAssertEqual(rows[2].prefetchTree.keys, ["cs"])
}
}