From f6b2c7e9f308064c452ceb322ebdfd863eb32fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 5 May 2019 17:46:05 +0200 Subject: [PATCH] More tests for consumption of prefetched rows --- Tests/GRDBTests/AssociationPrefetchingTests.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Tests/GRDBTests/AssociationPrefetchingTests.swift b/Tests/GRDBTests/AssociationPrefetchingTests.swift index c3145e05b..728eaca83 100644 --- a/Tests/GRDBTests/AssociationPrefetchingTests.swift +++ b/Tests/GRDBTests/AssociationPrefetchingTests.swift @@ -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"]) } }