Skip to content

Commit 4cd2049

Browse files
committed
fix(test): align boolean range regression coverage
1 parent dc441b6 commit 4cd2049

2 files changed

Lines changed: 6 additions & 14 deletions

File tree

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/ConditionQueryFlatten.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ private static List<ConditionQuery> flattenRelations(ConditionQuery query) {
265265
cq.query(nonRelations);
266266
return ImmutableList.of(cq);
267267
}
268-
return ImmutableList.of(query);
268+
return ImmutableList.of();
269269
}
270270

271271
private static Relations optimizeRelations(Relations relations) {

hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/EdgeCoreTest.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7121,8 +7121,6 @@ public void testQueryEdgeWithNullablePropertyInCompositeIndex() {
71217121
public void testQueryEdgeByBooleanRangePredicate() {
71227122
HugeGraph graph = graph();
71237123
initStrikeIndex();
7124-
graph.schema().indexLabel("strikeByArrested").onE("strike").secondary()
7125-
.by("arrested").create();
71267124

71277125
Vertex louise = graph.addVertex(T.label, "person", "name", "Louise",
71287126
"city", "Beijing", "age", 21);
@@ -7138,24 +7136,18 @@ public void testQueryEdgeByBooleanRangePredicate() {
71387136
"tool", "shovel", "reason", "jeer",
71397137
"arrested", true);
71407138

7141-
List<Edge> hasEdges = graph.traversal().E()
7142-
.has("arrested", P.lt(true))
7143-
.toList();
7144-
Assert.assertEquals(1, hasEdges.size());
7145-
Assert.assertEquals(1, (int) hasEdges.get(0).value("id"));
7146-
71477139
List<Edge> whereEdges = graph.traversal().E()
71487140
.where(__.has("arrested", P.lt(true)))
71497141
.toList();
71507142
Assert.assertEquals(1, whereEdges.size());
71517143
Assert.assertEquals(1, (int) whereEdges.get(0).value("id"));
71527144

71537145
List<Edge> matchEdges = graph.traversal().E()
7154-
.as("e")
7155-
.match(__.as("e")
7156-
.has("arrested", P.lt(true)))
7157-
.<Edge>select("e")
7158-
.dedup()
7146+
.match(__.as("start")
7147+
.where(__.has("arrested",
7148+
P.lt(true)))
7149+
.as("matched"))
7150+
.<Edge>select("matched")
71597151
.toList();
71607152
Assert.assertEquals(1, matchEdges.size());
71617153
Assert.assertEquals(1, (int) matchEdges.get(0).value("id"));

0 commit comments

Comments
 (0)