-
Notifications
You must be signed in to change notification settings - Fork 381
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
Enhanced Directory Pattern Matching Test Coverage #123
Enhanced Directory Pattern Matching Test Coverage #123
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RyanL2004 Thank you for taking the time to do this
You are right, the behaviour of the exclude/include patterns isn't ideal at the moment, I could use a little rework
As for the windows compatibility, I believe we sould not be adapting the tests to pass on windows: they are meant to not pass on windows because gitingest doesn't fully work on windows, so i think we should remove those changes
Maybe I did not understood fully the fix if so please tell me
@cyclotruc Thank you for the feedback about Windows compatibility ! You're absolutely right, I've removed all the Windows This better reflects the current state of GitIngest where Windows support isn't fully implemented. Changes I made:
The tests now:
Let me know if you'd like me to make any other changes! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the quick changes, merging
Overview
This PR adds comprehensive test coverage for directory pattern matching in GitIngest, focusing on how different patterns interact with directory structures and file inclusion. Through the development process, discovered several important behaviors of the pattern matching system.
Test Cases
1. Pattern Matching Behavior Discovery
Initially, started with previous assumption that patterns would work similar to common glob patterns:
src/*
would only match direct childrensrc/
would match recursivelyHowever, through testing, discovered the actual behavior:
src/*
matches all files recursively under src//src/*
) don't match any filessrc/**
2. Path Separator Issues
Encountered cross-platform compatibility issues with path separators:
Fixed by normalizing paths using
Path
:3. Test Evolution
Original Tests (Had Issues):
src/*
would only match direct childrenImproved Tests:
test_include_src_star_pattern
:src/*
matches all filestest_include_src_recursive
:src/
withsrc/**
for recursive matchingDirectory Structure Being Tested:
Technical Improvements
1. Path Normalization
2. Better Test Structure
3. Pattern Matching Documentation
Discovered and documented the actual pattern matching rules:
src/*
→ Matches all files under src/ recursivelysrc/**
→ Explicit recursive matchingTesting Strategy
Each test verifies:
Impact
These tests:
Future Considerations
Consider adding support for:
src/*
behaviorPotential documentation updates:
Learning Points