Skip to content

Glob support #17

@nyurik

Description

@nyurik

I was trying to adapt test-each-file to my https://github.com/oxibus/can-dbc-pest/tree/main/tests code, which uses large external git repositories with lots of files. My tests are only interested in one extension - .dbc, and with the current set up I have to filter for my extension inside the test function. The test is still generated for each irrelevant file recursively, making the output less useful. A side problem this solves is it ignores duplicates more often, e.g. README files.

Proposal

  • MVP: Support globs like "./tests/fixtures/**/*.dbc" - using globset (regex based, possibly faster) or glob (more established?) crate
  • Optional: Support exclusions, e.g. "/foobar/" to avoid certain subdirs or filenames. I think globset can help here. This could actually work the same way as .gitignore files - i.e. multiple strings passed to the test_each_path! macro, where if the line begins with the ! it will function as exclusion, whereas everything else includes it

Thx for the great crate!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions