This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3136 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 6b3ca5534692a88036d1e88863019d2d9010f9e8 Author: Stephen Mallette <stepm...@amazon.com> AuthorDate: Tue Apr 22 07:30:47 2025 -0400 address feedback --- docs/src/dev/developer/for-committers.asciidoc | 2 +- .../gremlin/process/traversal/step/util/TreeTest.java | 12 +++++++++--- .../apache/tinkerpop/gremlin/features/StepDefinition.java | 6 ++---- neo4j-gremlin/pom.xml | 1 + 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/src/dev/developer/for-committers.asciidoc b/docs/src/dev/developer/for-committers.asciidoc index c890ede3af..390d73e2c6 100644 --- a/docs/src/dev/developer/for-committers.asciidoc +++ b/docs/src/dev/developer/for-committers.asciidoc @@ -503,7 +503,7 @@ of traversal iteration where "_comparison_" may be one of "containing", "startin * "the result should be of" - results can be any of the specified values and in any order (use when guarantees regarding the exact results cannot be pre-determined easily - see the `range()`-step tests for examples) * "the result should be a graph with the following" - asserts a subgraph where the associated datatable is headed with -"vertices" or "edges" with a set of expected vertex or edge definitions +"vertices" or "edges" with a set of expected vertex or edge definitions (can only be used with the "modern" graph data) * "the result should be a tree with a structure of" - asserts a tree structure given as an asciiart representation of the expected tree. diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/TreeTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/TreeTest.java index 180d0e3612..af8441ac3d 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/TreeTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/TreeTest.java @@ -118,8 +118,12 @@ public class TreeTest extends StepTest { tree.get("root").put("child2", child2); // either can be expected since Tree doesn't maintain node order - final String expected1 = "|--root\n |--child1\n |--child2"; - final String expected2 = "|--root\n |--child2\n |--child1"; + final String expected1 = "|--root" + System.lineSeparator() + + " |--child1" + System.lineSeparator() + + " |--child2"; + final String expected2 = "|--root" + System.lineSeparator() + + " |--child2" + System.lineSeparator() + + " |--child1"; assertThat(tree.prettyPrint(), Matchers.anyOf(Matchers.is(expected1), Matchers.is(expected2))); } @@ -132,7 +136,9 @@ public class TreeTest extends StepTest { tree.get("root").put("child1", child1); tree.get("root").get("child1").put("grandchild", grandchild); - final String expected = "|--root\n |--child1\n |--grandchild"; + final String expected = "|--root" + System.lineSeparator() + + " |--child1" + System.lineSeparator() + + " |--grandchild"; assertEquals(expected, tree.prettyPrint()); } diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/StepDefinition.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/StepDefinition.java index 3feb406efc..39e6338cbe 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/StepDefinition.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/StepDefinition.java @@ -87,8 +87,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Optional; -import java.util.Stack; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -737,7 +735,7 @@ public final class StepDefinition { public List<TreeNode> parseTree(final String asciiTree) { if (asciiTree.isEmpty()) return Collections.emptyList(); - final List<String> lines = Arrays.asList(asciiTree.split("\n")); + final List<String> lines = Arrays.asList(asciiTree.split(System.lineSeparator())); final List<TreeNode> roots = new ArrayList<>(); final Map<Integer, TreeNode> levelMap = new HashMap<>(); @@ -764,7 +762,7 @@ public final class StepDefinition { if (c == ' ') count++; else break; } - return count / 3; // Assuming 4 spaces per level + return count / 3; // Assuming 3 spaces per level } /** diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml index c0e7091dc6..ed4b6b2e72 100644 --- a/neo4j-gremlin/pom.xml +++ b/neo4j-gremlin/pom.xml @@ -54,6 +54,7 @@ limitations under the License. <groupId>org.apache.tinkerpop</groupId> <artifactId>tinkergraph-gremlin</artifactId> <version>${project.version}</version> + <scope>test</scope> </dependency> <dependency> <groupId>com.google.inject</groupId>