Skip to content

regex pattern fails with length limiters or when end of string is present ($) #391

@ssbarnea

Description

@ssbarnea

There is something wrong on how the regex pattern is implemented as they seem to break:

  • ^[a-zA-Z-\s] looks like working
  • ^[a-zA-Z-\s]{2,40} incorrectly passes tests even with strings longer
  • ^[a-zA-Z-\s]{2,40}$ incorrectly fails all strings regardless of their length
  • ^[a-zA-Z-\s]$ incorrectly breaks the matching, even if inside the documentation are examples of patterns ending in $.

This prevents practical uses of regex for the two rules that can check the suite and test names.

As a side note, it would be very useful if we could have some placeholders for regex and string inside the message string, so we can generate a nice error message.

now: Keep suite name readable.
potential: Suite name does not match required {{regex}} pattern: {{suite}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions