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

str! creates bad snapshots when every line is indented #267

Closed
epage opened this issue Mar 13, 2024 · 1 comment · Fixed by #271
Closed

str! creates bad snapshots when every line is indented #267

epage opened this issue Mar 13, 2024 · 1 comment · Fixed by #271
Labels
A-snapbox Area: snapbox package breaking-change bug Not as expected

Comments

@epage
Copy link
Contributor

epage commented Mar 13, 2024

str! defaults to indent: true and it puts everything on dedicated lines. This means if all lines are indented, then there isn't a way to know how much indentation is needed.

@epage epage added breaking-change A-snapbox Area: snapbox package bug Not as expected labels Mar 13, 2024
@epage
Copy link
Contributor Author

epage commented Mar 13, 2024

I'd propose we switch the default indent: false so people don't run into this as easily. This would also reduce rightward drift.

epage added a commit to epage/snapbox that referenced this issue Apr 18, 2024
Rather than dealing with the special cases where this doesn't exist,
let's just not do this.

This also aligns with the general style within Cargo's tests.

Fixes assert-rs#267
epage added a commit to epage/snapbox that referenced this issue Apr 18, 2024
Rather than dealing with the special cases where this doesn't exist,
let's just not do this.

This also aligns with the general style within Cargo's tests.

Fixes assert-rs#267
epage added a commit to epage/snapbox that referenced this issue May 23, 2024
Rather than dealing with the special cases where this doesn't exist,
let's just not do this.

This also aligns with the general style within Cargo's tests.

Fixes assert-rs#267

Cherry pick 20d65cd (assert-rs#271)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-snapbox Area: snapbox package breaking-change bug Not as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant