Skip to content
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

cucumber-expressions: - sign withouth numbers matches as {double} #669

Closed
mpkorstanje opened this issue Aug 1, 2019 · 0 comments · Fixed by #672
Closed

cucumber-expressions: - sign withouth numbers matches as {double} #669

mpkorstanje opened this issue Aug 1, 2019 · 0 comments · Fixed by #672
Labels
🐛 bug Defect / Bug

Comments

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Aug 1, 2019

This in cucumber-jvm now fails with the latest cucumber-expressions snapshot:

    @Test
    public void generatesCopyPasteReadySnippetWhenStepHasIllegalJavaIdentifierChars() {
        String expected = "" +
            "@Given(\"I have {int} cukes in: my {string} red-belly!\")\n" +
            "public void i_have_cukes_in_my_red_belly(Integer int1, String string) {\n" +
            "    // Write code here that turns the phrase above into concrete actions\n" +
            "    throw new io.cucumber.java.PendingException();\n" +
            "}\n";
        assertEquals(expected, snippetFor("I have 4 cukes in: my \"big\" red-belly!"));
    }

With the snippet being:

@Given("I have {int} cukes in: my {string} red{double}belly!")
public void i_have_cukes_in_my_red_belly(Integer int1, String string, Double double1) {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}

Looks like the - is matched as a double.

mpkorstanje added a commit that referenced this issue Aug 2, 2019
Properly match decimal numbers taking into account that a decimal has:
 * at least one number
 * optional negative/positive sign
 * a number preceding/succeeding the thousands separator
 * may have multiple thousands separators
 * may have a single decimal separator
 * may start with a decimal separator
 * an optional fractional part
 * an optional scientific exponent notation
 * decimal separator that differs from the thousands separator
 * thousands separator can be space, comma or period^
 * decimal separator can be comma or period^

^ See: [International Language Environments Guide - Decimal and Thousands Separators](https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html)

Fixes #669
mpkorstanje added a commit that referenced this issue Aug 2, 2019
Properly match decimal numbers taking into account that a decimal has:
 * at least one number
 * optional negative/positive sign
 * a number preceding/succeeding the thousands separator
 * may have multiple thousands separators
 * may have a single decimal separator
 * may start with a decimal separator
 * an optional fractional part
 * an optional scientific exponent notation
 * localized decimal and grouping characters

^ See: [International Language Environments Guide - Decimal and Thousands Separators](https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html)

Fixes #669
mpkorstanje added a commit that referenced this issue Aug 2, 2019
Properly match decimal numbers taking into account that a decimal has:
 * at least one number
 * optional negative/positive sign
 * a number preceding/succeeding the thousands separator
 * may have multiple thousands separators
 * may have a single decimal separator
 * may start with a decimal separator
 * an optional fractional part
 * an optional scientific exponent notation
 * localized decimal and grouping characters

^ See: [International Language Environments Guide - Decimal and Thousands Separators](https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html)

Fixes #669
mpkorstanje added a commit that referenced this issue Aug 3, 2019
Properly match decimal numbers taking into account that a decimal has:
 * at least one number
 * optional negative/positive sign
 * a number preceding/succeeding the thousands separator
 * may have multiple thousands separators
 * may have a single decimal separator
 * may start with a decimal separator
 * an optional fractional part
 * an optional scientific exponent notation
 * localized decimal and grouping characters

^ See: [International Language Environments Guide - Decimal and Thousands Separators](https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html)

Fixes #669
mpkorstanje added a commit that referenced this issue Aug 3, 2019
Properly match decimal numbers taking into account that a decimal has:
 * at least one number
 * optional negative/positive sign
 * a number preceding/succeeding the thousands separator
 * may have multiple thousands separators
 * may have a single decimal separator
 * may start with a decimal separator
 * an optional fractional part
 * an optional scientific exponent notation
 * localized decimal and grouping characters

^ See: [International Language Environments Guide - Decimal and Thousands Separators](https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html)

Fixes #669
mpkorstanje added a commit that referenced this issue Aug 3, 2019
Properly match decimal numbers taking into account that a decimal has:
 * at least one number
 * optional negative/positive sign
 * a number preceding/succeeding the thousands separator
 * may have multiple thousands separators
 * may have a single decimal separator
 * may start with a decimal separator
 * an optional fractional part
 * an optional scientific exponent notation
 * localized decimal and grouping characters

^ See: [International Language Environments Guide - Decimal and Thousands Separators](https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html)

Fixes #669
aslakhellesoy added a commit that referenced this issue Aug 4, 2019
aslakhellesoy pushed a commit that referenced this issue Aug 4, 2019
* cucumber-expressions: Improve decimal number parsing

Properly match decimal numbers taking into account that a decimal has:
 * at least one number
 * optional negative/positive sign
 * a number preceding/succeeding the thousands separator
 * may have multiple thousands separators
 * may have a single decimal separator
 * may start with a decimal separator
 * an optional fractional part
 * an optional scientific exponent notation
 * localized decimal and grouping characters

^ See: [International Language Environments Guide - Decimal and Thousands Separators](https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html)

Fixes #669

* cucumber-expressions: Improve decimal number parsing in go

* cucumber-expressions: Improve decimal number parsing in ruby

* cucumber-expressions: Improve decimal number parsing in js

* Attribution. Closes #657, closes #661

* Attribution. Closes #669, closes #672
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Defect / Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant