JBehave
  1. JBehave
  2. JBEHAVE-974

Allow step pattern parameter names to use a configurable character class

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.9
    • Fix Version/s: 3.9.1
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Upgrading from 3.8 to 3.9 you may have found that the parameter names could not contain digits.

      This was due to a change JBEHAVE-957 which added support for unicode characters.

      Support for digits has now been restored and in addition the character class used to find parameter names has been made configurable, defaulting to

      [\p{L}\p{N}]

      .

      To restrict parameter names to letters only, use

      [\p{L}]

      .

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Fix Version/s 3.9.1 [ 19830 ]
        Assignee Mauro Talevi [ maurotalevi ]
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Summary @Given not parsed when parameter ends with digit Allow step pattern parameter placeholder name to contain digits
        Mauro Talevi made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Mauro Talevi made changes -
        Description Upgrading from 3.8 to 3.9 broke some of our stories.

        If I run the following destilled.story:
        Scenario: s1
        Given given1 param

        Scenario: s2
        Given given2 param

        With the following steps class:
        public class DestilledSteps {
            @Given("given1 $param")
            public void given1(String param) {
                System.out.printf("--given1(%s)--%n", param);
            }

            @Given("given2 $paramWithNumberAtEnd1")
            public void given2(String param) {
                System.out.printf("--given2(%s)--%n", param);
            }
        }

        I get the following output:
        Scenario: s1
        --given1(param)--
        Given given1 param

        Scenario: s2
        Given given2 param (PENDING)
        @Given("given2 param")
        @Pending
        public void givenGiven2Param() {
          // PENDING
        }

        what feels like a bug to me.
        The first scenario works as expected, while the second has a pending step.

        With 3.8 one could use parameters like "$1".
        Workaround: use parameters without digits.
        Upgrading from 3.8 to 3.9 you may have found that the parameter names could not contain digits.

        This was due to a change JBEHAVE-957 which added support for unicode characters.

        Support for digits has now been restored and in addition the character class used to find parameter names has been made configurable, defaulting to [\p{L}\p{N}].

        To restrict parameter names to letters only, use [\p{L}]


        Summary Allow step pattern parameter placeholder name to contain digits Allow step pattern parameter names to use a configurable character class
        Mauro Talevi made changes -
        Description Upgrading from 3.8 to 3.9 you may have found that the parameter names could not contain digits.

        This was due to a change JBEHAVE-957 which added support for unicode characters.

        Support for digits has now been restored and in addition the character class used to find parameter names has been made configurable, defaulting to [\p{L}\p{N}].

        To restrict parameter names to letters only, use [\p{L}]


        Upgrading from 3.8 to 3.9 you may have found that the parameter names could not contain digits.

        This was due to a change JBEHAVE-957 which added support for unicode characters.

        Support for digits has now been restored and in addition the character class used to find parameter names has been made configurable, defaulting to [\p{L}\p{N}].

        To restrict parameter names to letters only, use [\p{L}].
        Mauro Talevi made changes -
        Description Upgrading from 3.8 to 3.9 you may have found that the parameter names could not contain digits.

        This was due to a change JBEHAVE-957 which added support for unicode characters.

        Support for digits has now been restored and in addition the character class used to find parameter names has been made configurable, defaulting to [\p{L}\p{N}].

        To restrict parameter names to letters only, use [\p{L}].
        Upgrading from 3.8 to 3.9 you may have found that the parameter names could not contain digits.

        This was due to a change JBEHAVE-957 which added support for unicode characters.

        Support for digits has now been restored and in addition the character class used to find parameter names has been made configurable, defaulting to <pre>[\p{L}\p{N}]</pre>.

        To restrict parameter names to letters only, use <pre>[\p{L}]</pre>.
        Mauro Talevi made changes -
        Description Upgrading from 3.8 to 3.9 you may have found that the parameter names could not contain digits.

        This was due to a change JBEHAVE-957 which added support for unicode characters.

        Support for digits has now been restored and in addition the character class used to find parameter names has been made configurable, defaulting to <pre>[\p{L}\p{N}]</pre>.

        To restrict parameter names to letters only, use <pre>[\p{L}]</pre>.
        Upgrading from 3.8 to 3.9 you may have found that the parameter names could not contain digits.

        This was due to a change JBEHAVE-957 which added support for unicode characters.

        Support for digits has now been restored and in addition the character class used to find parameter names has been made configurable, defaulting to {code:java}[\p{L}\p{N}]{code}.

        To restrict parameter names to letters only, use {code:java}[\p{L}]{code}.
        Mauro Talevi made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Resolved [ 5 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Frank Neblung
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: