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

Testcase name parser with named groups #84

Open
codito opened this issue Jun 25, 2024 · 0 comments
Open

Testcase name parser with named groups #84

codito opened this issue Jun 25, 2024 · 0 comments
Labels
enhancement New feature or request logger: core Core test logger related issues

Comments

@codito
Copy link
Contributor

codito commented Jun 25, 2024

TestCaseNameParser uses the following regex for extracting class, method names:

    /// <summary>
    /// This one can handle standard formatting with or without method data.
    /// </summary>
    private static readonly Regex MethodRegex = new (@"^([a-z0-9_.]{1,})\.([a-z0-9_.+]{1,})\.(.{1,})$", RegexOptions);


    /// <summary>
    /// Can handle standard formatting with class and method data.
    /// </summary>
    private static readonly Regex ClassDataRegex = new (@"^([a-z0-9_.]{1,})\.([a-z0-9_.]{1,}\(.{0,}\))\.(.{1,})$", RegexOptions);

This format doesn't work with custom naming, e.g. spekt/junit.testlogger#76
Also related spekt/junit.testlogger#79 to specify custom class name format.

Proposal

Can we allow custom regex (with named groups) for test case name parser?

@codito codito added enhancement New feature or request logger: core Core test logger related issues labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request logger: core Core test logger related issues
Projects
None yet
Development

No branches or pull requests

1 participant