Comments (8)
Might be better to parse to big int and big decimal and then down grade or throw a conversation exception if it doesn't fit. That way the expected type can be described.
from cucumber-expressions.
Instead of deprecation I'd consider straight up removal. Cucumber JVM can add them back as part of a graceful deprecation.
It will be easier to handle tbe deprecation warning in Cucumber JVM because it has logging facilities.
It's also easier to handle tbe deprecation there because Cucumber JVM controls it's life cycle. If we do it here then we won't be able to upgrade cucumber expressions in cucumber JVM until it goes to the next major.
from cucumber-expressions.
For the tooling it will be trickier will be dealing with Javas localized number parsing. Different languages use different symbols for thousands and decimals. This is build into Javas number parsing and changes the regular expression used.
from cucumber-expressions.
Maybe an easier solution would be to make the Java specific types work in the other languages too but always provide the int/float equivalent?
from cucumber-expressions.
For the tooling it will be trickier will be dealing with Javas localized number parsing. Different languages use different symbols for thousands and decimals. This is build into Javas number parsing and changes the regular expression used.
Yes, I'm aware of that. JavaScript's Intl has similar locale-specific number parsing, but it behaves slightly differently from Java's. For example 123456,789
in Norwegian is formatted as 123.456,789
on Java and 123 456,789
on JavaScript (uses a space as thousand-separator).
This makes it tricky to have cross-platform tooling, but I think that's a separate problem from deprecating the java-specific types. We can deal with that in a different issue.
from cucumber-expressions.
Maybe an easier solution would be to make the Java specific types work in the other languages too but always provide the int/float equivalent?
That's the approach I started with in #42. It's certainly easier to implement, but it feels like a bit of a hack. From a user's perspective I think it would be nicer if we had fewer parameter types and handle the conversion transparently for the user.
But I'm not sure the added complexity is worth it...
from cucumber-expressions.
As I was working on #42, I discovered that Ruby actually has a BigDecimal class.
Since Ruby is a dynamically typed language, it would be impossible to convert e.g. "123.456" into a BigDecimal
with what I have proposed in this issue.
So I think it's probably best to go down the route of adding all the Java parameter types to all the implementations and call it a day.
Agree? Shall I close this?
from cucumber-expressions.
Yeah. This is one of them horses.
from cucumber-expressions.
Related Issues (20)
- Remove Python example illustrating how to define parameter types HOT 2
- more powerful optional text HOT 12
- Allow free-form text in optionals HOT 1
- Expression for an argument list HOT 4
- Improve Expression creation performance HOT 2
- Use action-publish-pypi in cucumber-expressions
- Optimize Cucumber expression creation in .Net implementation
- Action Required: Fix Renovate Configuration
- Bad CucumberExpression creation performance HOT 6
- Golang big.Float is not a big decimal HOT 12
- Feature: named capture groups HOT 13
- Missing source for source map
- RegEx "expressions" and defineParameterType feature file examples ?
- Add the ability to ignore a cucumber expression parameter just like a non capturing regex HOT 12
- Nested capture groups are not passed to custom param definition transformer HOT 8
- `end` as a method name / prop can cause some issues HOT 4
- LICENSE file is empty HOT 1
- Typo in error message for use of alternation inside an optional
- Unable to parse negative number in Norwegian HOT 11
- Released Ruby gem is missing LICENSE file. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cucumber-expressions.