From 120c973e292d5e0e142cd8950d4bd3be77bf084e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 20 Jun 2021 14:31:45 +0200 Subject: [PATCH] Refactor test for association from CTE to Table --- .../CommonTableExpressionTests.swift | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/Tests/GRDBTests/CommonTableExpressionTests.swift b/Tests/GRDBTests/CommonTableExpressionTests.swift index 45ba9f4ab..1352da2de 100644 --- a/Tests/GRDBTests/CommonTableExpressionTests.swift +++ b/Tests/GRDBTests/CommonTableExpressionTests.swift @@ -295,25 +295,10 @@ class CommonTableExpressionTests: GRDBTestCase { literal: "SELECT \("O'Brien")") let assoc1 = T.association(to: cte1) let assoc2 = cte1.association(to: cte2) - do { - let assoc3 = cte2.association(to: T.self) - let request = T.all() - .with(cte1) - .with(cte2) - .including(required: assoc1.including(required: assoc2.including(required: assoc3))) - try assertEqualSQL(db, request, """ - WITH \ - "cte1" AS (SELECT * FROM "t"), \ - "cte2" AS (SELECT 'O''Brien') \ - SELECT "t1".*, "cte1".*, "cte2".*, "t2".* \ - FROM "t" "t1" \ - JOIN "cte1" \ - JOIN "cte2" \ - JOIN "t" "t2" - """) - } - do { - let assoc3 = cte2.association(to: Table("t")) + for assoc3 in [ + cte2.association(to: T.self), + cte2.association(to: Table("t")), + ] { let request = T.all() .with(cte1) .with(cte2)