-
-
Notifications
You must be signed in to change notification settings - Fork 689
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
Regex with single char output throws exception #1405
Comments
Raised a PR to fix the issue in |
This doesn't feel a bug in Ruby, because in ruby we just use the string type for all strings of arbitrary length. I suppose we could add it for standardisation, but it would rarely get used, because All 3 would have the same return type I do understand the need in java for this, because (From my limited knowledge), the char type and the String type are fundamentally different taking up different amounts of memory. Thoughts @mpkorstanje ?? Do we want to add this to other languages for standardisation? Where else would this be "active" (i.e. is Ruby the normal or the exception) |
I don't think this affects anything but Java and Go. |
Given that then, I'd err on the side of only adding it to Java and Go. As it's a reasonably small change and it's ok to have slight differences. But then again these default ones we promote to our docs. I dunno I'm kinda on the fence as you can guess. |
These are not parameter types. The |
Fixed in v12.0.1 |
Summary
Regex which matches a single character (e.g "^ User ([ABZ])$") leads to a
CucumberExpressionException
becauseBuiltInParameterTransformer
incucumber-expressions-java
doesn't have a character transformer even though type is deciphered as char shown in the screenshot attached.Expected Behavior
If the type is deciphered as char,
BuiltInParameterTransformer
should return it as char.Current Behavior
Currently it simply throws the exception:
io.cucumber.cucumberexpressions.CucumberExpressionException: ParameterType {anonymous} failed to transform [B] to char
Possible Solution
We can have a transformer for character type in
BuiltInParameterTransformer
Steps to Reproduce (for bugs)
A simple step with Regex which matches single char can reproduce it.
Context & Motivation
I updated cucumber version to
6.10.0
and it broke my existing test cases.Your Environment
6.10.0
The text was updated successfully, but these errors were encountered: