Skip to content

Add specs for File.match? from fast-glob #15604

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

Conversation

straight-shoota
Copy link
Member

@straight-shoota straight-shoota commented Mar 25, 2025

Imports test cases for File.match? from https://github.com/oxc-project/fast-glob/blob/main/tests/test.rs to enhance the spec suite.

I'm planning to fix issue #15319 by porting the matching algorithm from fast-glob to Crystal. This is a preparatory step to import the test cases from the base implementation. Our current match_spec.cr lacks unit tests for many edge cases, which are covered here. Importing them beforehand makes it clear to identify the differences in behaviour, and it's easier to review in smaller bites.
I figure it should be easier to maintain this as a separate test file with a generator to easily include new test from upstream.
Most of the examples originate from other projects, bash and minimatch.
In violation of the DO NOT EDIT directive, I'm encoding the currently broken test cases directly in the generated file. This will be fixed shortly in #15607.

The original tests also include a list of more complex patterns, which are tested against a huge list of paths. I'm skipping them here because they need specific code to run them, and add them separately. They're all broken anyway due to #15319.
Similarly, some fuzz specs are also a bit more complex for a simple transform, so they'll be added separately as well.

Related: #15601

@straight-shoota straight-shoota added this to the 1.16.0 milestone Mar 27, 2025
@straight-shoota straight-shoota merged commit 4eed8ab into crystal-lang:master Mar 28, 2025
32 checks passed
@straight-shoota straight-shoota deleted the spec/file-match-fast_glob-spec-suite branch March 28, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants