Skip to content

Add specs for File.match? with multibyte characters #15601

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

Merged

Conversation

straight-shoota
Copy link
Member

No description provided.

@straight-shoota straight-shoota added this to the 1.16.0 milestone Mar 27, 2025
straight-shoota added a commit that referenced this pull request Mar 28, 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 anyway.

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 merged commit 24f5c02 into crystal-lang:master Mar 28, 2025
32 checks passed
@straight-shoota straight-shoota deleted the spec/file-match-unicode branch March 28, 2025 19:25
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.

2 participants