             ("testAggregateWindowFunction9", testAggregateWindowFunction9),
             ("testAggregateWindowFunction10", testAggregateWindowFunction10),
             ("testAggregateWindowFunction11", testAggregateWindowFunction11),
+            ("testAggregateWindowFunction_aggregates", testAggregateWindowFunction_aggregates),
+            ("testDistinctAggregate", testDistinctAggregate),
         ]
     }
 }

            ("testAggregateWindowFunction3", testAggregateWindowFunction3),
            ("testAggregateWindowFunction5", testAggregateWindowFunction5),
            ("testAggregateWindowFunction6", testAggregateWindowFunction6),
        ]
    }
}

}

extension QueryEvaluationTests {
    var testQuads: [Quad] {
        let parser = NTriplesParser(reader: "")
        
        guard let b1 = parser.parseQuad(line: "<http://example.org/Berlin> <http://xmlns.com/foaf/0.1/name> \"Berlin\"", graph: self.graph) else { fatalError() }
        guard let b2 = parser.parseQuad(line: "<http://example.org/Berlin> <http://xmlns.com/foaf/0.1/homepage> <http://www.berlin.de/en/>", graph: self.graph) else { fatalError() }
        guard let s = parser.parseQuad(line: "_:a <http://purl.org/dc/elements/1.1/title> \"Santa Monica\"", graph: self.graph) else { fatalError() }
        
        let numbers = Term(value: "http://example.org/numbers", type: .iri)
        guard let n0 = parser.parseQuad(line: "_:n1 <http://xmlns.com/foaf/0.1/name> \"a number\"", graph: numbers) else { fatalError() }
        guard let n1 = parser.parseQuad(line: "_:n1 <http://example.org/value> \"32.7\"^^<http://www.w3.org/2001/XMLSchema#float>", graph: numbers) else { fatalError() }
        guard let n2 = parser.parseQuad(line: "_:n2 <http://example.org/value> \"-118\"^^<http://www.w3.org/2001/XMLSchema#integer>", graph: numbers) else { fatalError() }
        
        let other = Term(value: "http://example.org/other", type: .iri)
        guard let x1 = parser.parseQuad(line: "_:x <http://example.org/p> \"hello\"@en", graph: other) else { fatalError() }
        
        let quads = [b1, b2, s, n0, n1, n2, x1]
        return quads
    }

    func parse(query: String) -> Algebra? {
        let qp      = QueryParser(reader: query)
        do {
