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

Fix relative file paths in spec output #14725

Merged

Conversation

straight-shoota
Copy link
Member

Relativized paths in the spec output (for example for Failed examples) are wrong on Windows. They incorrectly include a leading directory separator, making them relative to the drive root:

Failed examples:

crystal spec \spec\fail_spec.cr:3 # assert

The implementation does not account for other directory separators than \.
This fix replaces it with Path#relative_to which handles this correctly.

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. platform:windows Windows support based on the MSVC toolchain topic:stdlib:specs labels Jun 17, 2024
@straight-shoota straight-shoota self-assigned this Jun 17, 2024
@straight-shoota straight-shoota added this to the 1.13.0 milestone Jun 18, 2024
@straight-shoota straight-shoota merged commit 2c62b19 into crystal-lang:master Jun 20, 2024
61 checks passed
@straight-shoota straight-shoota deleted the fix/spec-error-path branch June 20, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. platform:windows Windows support based on the MSVC toolchain topic:stdlib:specs
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants