[ https://issues.apache.org/jira/browse/TINKERPOP-2334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17780020#comment-17780020 ]
ASF GitHub Bot commented on TINKERPOP-2334: ------------------------------------------- kenhuuu commented on code in PR #2307: URL: https://github.com/apache/tinkerpop/pull/2307#discussion_r1373489595 ########## gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Format.feature: ########## @@ -0,0 +1,141 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +@StepClassMap @StepFormat +Feature: Step - format() + + Scenario: g_VX1X_formatXstrX Review Comment: A few tests to consider: 1) Null argument. 2) Empty String argument. 3) A bigger mix of positional and named, so ${value}, ${_}, ${value2}, ${_} ... 4) A test with an unsupported traverser (like a list). > Add format() step > ----------------- > > Key: TINKERPOP-2334 > URL: https://issues.apache.org/jira/browse/TINKERPOP-2334 > Project: TinkerPop > Issue Type: Improvement > Components: process > Affects Versions: 3.4.4 > Reporter: Stephen Mallette > Assignee: Valentyn Kahamlyk > Priority: Major > > Provide for a {{format()}} step which will handle result formatting to string > values. This change will help resolve the need for string concatenation > functions while providing a lot of flexibility to how results can be formed: > {code} > gremlin> g.V().hasLabel('person').format("%{n} is %{a} years old.").by('n', > 'name').by('a', 'age') > ==>marko is 29 years old. > ==>vadas is 27 years old. > ==>josh is 32 years old. > ==>peter is 35 years old. > gremlin> g.V().hasLabel('person').format("%{name} is %{age} years old.") > ==>marko is 29 years old. > ==>vadas is 27 years old. > ==>josh is 32 years old. > ==>peter is 35 years old. > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)