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 panic on scanning indentation of arbitrary lines #723

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Feb 12, 2025

thread 'main' panicked at cargo-insta/src/inline.rs:130:22:
byte index 32 is out of bounds of `    insta::assert_snapshot!(`

Maybe we could instead test macro_start.line == self.0, but it's easier to just
look up text by macro_start.line.
@ilyagr
Copy link

ilyagr commented Feb 12, 2025

I'm a bit confused about this PR. It conflicts with #722 and my naive attempt to resolve the conflict resulted in broken tests.

Perhaps it should be a draft until #722 is merged?

@yuja
Copy link
Contributor Author

yuja commented Feb 13, 2025

I can rebase this or #722 as needed. They're different patches and I think this bug is more important than #722 because it's a regression.

@max-sixty
Copy link
Collaborator

Thanks a lot @yuja !

If you want to add a changelog + attribution later, that would be great! No obligation though

@max-sixty max-sixty merged commit 24f32aa into mitsuhiko:master Feb 13, 2025
15 checks passed
@max-sixty max-sixty changed the title Fix crash on scanning indentation of arbitrary lines Fix panic on scanning indentation of arbitrary lines Feb 13, 2025
@yuja yuja deleted the push-mkslskrnvmum branch February 13, 2025 03:50
@yuja
Copy link
Contributor Author

yuja commented Feb 13, 2025

The bug doesn't exist in the released version, so I don't think changelog entry is needed. Thanks for reviewing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants