kenhuuu commented on code in PR #2361:
URL: https://github.com/apache/tinkerpop/pull/2361#discussion_r1404661207
##########
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java:
##########
@@ -158,6 +159,16 @@ else if (stepMethod.getName().equals("to") ||
stepMethod.getName().equals("from"
}
} else if (stepMethod.getName().equals("math")) {
list.add(arguments[0] = random.nextInt(100) + " + " +
random.nextInt(100));
+ } else if (stepMethod.getName().equals("project")) {
+ // project has two arguments [String, String[]]
+ list.add(arguments[0] = randomString(random));
+ arguments[1] = new String[random.nextInt(10) + 1];
+ for (int j = 0; j < ((String[]) arguments[1]).length; j++)
{
+ ((String[]) arguments[1])[j] = arguments[0] +
randomString(random); // adds argument[0] to avoid getting its duplicate in
argument[1]
+ }
+ // remove duplicates in argument[1] if any
+ arguments[1] = Arrays.stream((String[])
arguments[1]).distinct().toArray(String[]::new);
+ list.addAll(Arrays.stream((String[])
arguments[1]).collect(Collectors.toList()));
Review Comment:
Might be able to do something similar to
```suggestion
list.addAll(Arrays.asList(argument[1]);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]