提交 7fad89a5 编写于 作者: P Pontus Melke

fix broken test

上级 92241c2f
...@@ -1463,14 +1463,9 @@ trait PipelinedMergeTestBase[CONTEXT <: RuntimeContext] { ...@@ -1463,14 +1463,9 @@ trait PipelinedMergeTestBase[CONTEXT <: RuntimeContext] {
// then // then
val runtimeResult: RecordingRuntimeResult = execute(logicalQuery, runtime) val runtimeResult: RecordingRuntimeResult = execute(logicalQuery, runtime)
consume(runtimeResult) consume(runtimeResult)
val allRelationships = tx.getAllRelationships val r =
try { Iterators.single(tx.getAllRelationships.stream().filter(r => r.isType(RelationshipType.withName("R"))).iterator())
val r = runtimeResult should beColumns("r").withSingleRow(r).withStatistics(nodesCreated = 2, relationshipsCreated = 1)
Iterators.single(allRelationships.stream().filter(r => r.isType(RelationshipType.withName("R"))).iterator())
runtimeResult should beColumns("r").withSingleRow(r).withStatistics(nodesCreated = 2, relationshipsCreated = 1)
} finally {
allRelationships.close()
}
} }
test("merge should match nodes and relationship with undirected relationship type scan") { test("merge should match nodes and relationship with undirected relationship type scan") {
...@@ -1491,48 +1486,5 @@ trait PipelinedMergeTestBase[CONTEXT <: RuntimeContext] { ...@@ -1491,48 +1486,5 @@ trait PipelinedMergeTestBase[CONTEXT <: RuntimeContext] {
consume(runtimeResult) consume(runtimeResult)
runtimeResult should beColumns("r").withRows(singleColumn(rels.flatMap(r => Seq(r, r)))).withNoUpdates() runtimeResult should beColumns("r").withRows(singleColumn(rels.flatMap(r => Seq(r, r)))).withNoUpdates()
} }
test("merge should create nodes and relationship with empty undirected all relationship scan") {
// given empty database
// when
val logicalQuery = new LogicalQueryBuilder(this)
.produceResults("r")
.merge(nodes = Seq(createNode("n"), createNode("m")), relationships = Seq(createRelationship("r", "n", "R", "m")))
.filter("r:R")
.allRelationshipsScan("(n)-[r]-(m)")
.build(readOnly = false)
// then
val runtimeResult: RecordingRuntimeResult = execute(logicalQuery, runtime)
consume(runtimeResult)
val allRelationships = tx.getAllRelationships
try {
val r =
Iterators.single(allRelationships.stream().filter(r => r.isType(RelationshipType.withName("R"))).iterator())
runtimeResult should beColumns("r").withSingleRow(r).withStatistics(nodesCreated = 2, relationshipsCreated = 1)
} finally {
allRelationships.close()
}
}
test("merge should match nodes and relationship with undirected all relationship scan") {
val (_, rels) = given {
circleGraph(sizeHint)
}
// when
val logicalQuery = new LogicalQueryBuilder(this)
.produceResults("r")
.merge(nodes = Seq(createNode("n"), createNode("m")), relationships = Seq(createRelationship("r", "n", "S", "m")))
.filter("r:R")
.allRelationshipsScan("(n)-[r]-(m)")
.build(readOnly = false)
// then
val runtimeResult: RecordingRuntimeResult = execute(logicalQuery, runtime)
consume(runtimeResult)
runtimeResult should beColumns("r").withRows(singleColumn(rels.flatMap(r => Seq(r, r)))).withNoUpdates()
}
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册