-
-
Notifications
You must be signed in to change notification settings - Fork 691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gerkin: Paramater type {float} not matching 0 (zero). #600
Comments
Thanks for the detailed report @alcarwk! |
This is a little tricky to implement, but not impossible. The first step is to change The tricky part is in the expression generation. We still want Would you be interested in helping us with a PR for this? |
Thanks for the response to this. At the moment I'm using a parameter type definition defined as {number} that matches both integer and float returning a Double. Time permitting I would like to help with adding this as a new feature. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
Give us more time stalebot! |
Summary
The Gerkin parameter {float} does not match a simple 0 value. It seem to be treating this as an integer and thus looking for an integer step to match with. Any {float} steps are ignored as potential matches.
This is manly a problem as the Business stakeholders that are preparing Features and Scenarios do not understand that the difference between a 0 integer value and a 0.0 float value. They're mathematicians and consider 0 (integer) to belong to the domain of Real numbers and thus a valid value identical to the 0.0 (float) (likewise 1 is identical 1.0, and so on for all Integer values).
The Step where this is an issue has five parameters that are all likely float values yet are also possible Integer numbers. Supporting variations for all five possible matches would be somewhat cumbersome. (The other alternative of providing a custom type using a regular expression also isn't ideal.)
Expected Behavior
If matching on an Integer parameter and no {int} steps is found yet a matching {float} step exists then this will be used.
Current Behavior
If matching on an Integer and no {int} exist no matching takes place even if an acceptable {float} match is available.
Possible Solution
Accept that Integer values are acceptable subset of Real numbers and thus also acceptable matches for {float} parameter type iff no acceptable {int} step exists.
Context & Motivation
Features are intended to be prepared by domain experts that have no specialized understanding of computing environments. With this in mind interpretations of specific types of information provided in scenarios need to be aligned with the "common" understanding familiar to the domain experts.
The text was updated successfully, but these errors were encountered: