                     let testQuadStore = try quadStore(from: dataset, defaultGraph: testDefaultGraph)
                     if verbose {
                         print("Test quadstore: \(testQuadStore)")
-                    }
-                    let result = try query.execute(quadstore: testQuadStore, defaultGraph: testDefaultGraph)
+                        for (i, q) in testQuadStore.enumerated() {
+                            print("[\(i)] \(q)")
+                        }
+                        print("======================")
+                    }
+                    
+                    let result = try evaluate(query: query, in: testQuadStore, dataset: dataset, defaultGraph: testDefaultGraph)
                     if result == expectedResult {
                         results.append(.success(iri: test.value))
                     } else {

        return result
    }
    
    public func runEvaluationTest() -> TestResult {
        return .failure(iri: "", reason: "")
    }

    public func runEvaluationTests(inPath path: URL, testType: Term?, skip: Set<String>? = nil) throws -> [TestResult] {
        if let skip = skip {
            return try runEvaluationTests(inPath: path, testType: testType) {

        return results
    }

    func evaluate(query: Query, in store: TestedQuadStore, dataset: Dataset, defaultGraph: Term) throws -> QueryResult<[TermResult], [Triple]> {
        do {
            let e = QueryPlanEvaluator(store: store, dataset: dataset, base: query.base)
//            e.planner.allowStoreOptimizedPlans = false
            let result = try e.evaluate(query: query, activeGraph: defaultGraph)
//            print("Successful query plan evaluation")
            switch result {
            case let .bindings(vars, rows):
                return .bindings(vars, Array(rows))
            case .boolean(let b):
                return .boolean(b)
            case .triples(let t):
                return .triples(Array(t))
            }
        } catch let error {
            print("*** Failed to generate query plan: \(error)")
            throw error
        }
    }
    
    func datasetDescription(from quadstore: MemoryQuadStore, for term: Term, defaultGraph graph: Term) throws -> Dataset {
        var d = Dataset()
        let prefix = "http://www.w3.org/2001/sw/DataAccess/tests/test-query#"
