Coder Social home page Coder Social logo

Comments (4)

mpkorstanje avatar mpkorstanje commented on July 23, 2024

It's on the agenda for consideration.

I'm curious how your example is supposed to work though. Currently @ParameterType("^(?:(?:,|;|and|or)?\s?\w+)+$") shouldn't work because the ^ and $ would match the start and end of line.

from cucumber-expressions.

mpkorstanje avatar mpkorstanje commented on July 23, 2024

And the biggest obstacle is going to be getting the CSV parsing/language parsing done right. Imagine a separator that is also part of a product name:

Given the products Dumbo the Flying Elephant, "Spike and Suzy" and Lord of the Rings

Not to mention the Oxford comma, so now we combine two different separators with no products in between:

Given the products Dumbo the Flying Elephant, "Spike and Suzy", and Lord of the Rings 

And I have no idea how this works in other languages that aren't English. So it might not be possible to come up with a good solution.

from cucumber-expressions.

mmiikkkkaa avatar mmiikkkkaa commented on July 23, 2024

I'm curious how your example is supposed to work though. Currently @ParameterType("^(?:(?:,|;|and|or)?\s?\w+)+$") shouldn't work because the ^ and $ would match the start and end of line.

I tried it without ^ and $, I guess it was kind of an automatism of myself, to add it in my description here. So Please ignore it. 😅

Regarding the other concerns: they are of course tricky, but if it is up to the user to provide possible separators (so no default separators, but explicitly provided ones) and the test data, it might (at least in a first step) simply be the users responsibility to chose both wisely.

If only "," and ";" are provided as separators, neither the language nor the test data itself should be a problem. Also possible would be ignoring separators within quotes, like in your example. The Oxford comma might remain as a problem, as long as it is not also provided as a separator, like

@ParameterType(regex = "\\w+", separators=[",", ";", "and", "or", ", and", ", or"])
  fun product(product: String): List<Product> {
    return Product(it)
  }

from cucumber-expressions.

mattwynne avatar mattwynne commented on July 23, 2024

I'm curious why you want to put this list on a single line, rather than using a single-column DataTable beneath the step?

from cucumber-expressions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.