Skip to content

Consider dedicated syntax for unit tests #12

@kgutwin

Description

@kgutwin

Imagine something like this:

some of <word>;
<space>;
capture {
  1 to 9;
  2 of <digit>;
}

should match "Econ 101" capturing "101";
should not match "305";
should not match "Physics 022"

If you have the ability to embed tiny unit tests in your regex declaration, then this could substantially help both to catch regressions and to document the intent behind the regex. The unit tests would be run at compile time, raising something akin to a syntax error if they fail (with clear output as to why they failed, to make it easier to fix).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsyntaxConcerning the Melody language syntax

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions