-
Notifications
You must be signed in to change notification settings - Fork 405
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
tests: run insta --force-update-snapshots
#5558
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -702,7 +702,7 @@ mod tests { | |
}; | ||
// First output is after the initial delay | ||
assert_snapshot!(update(crate::progress::INITIAL_DELAY - Duration::from_millis(1), 0.1), @""); | ||
assert_snapshot!(update(Duration::from_millis(1), 0.10), @"[?25l\r 10% [█▊ ][K"); | ||
assert_snapshot!(update(Duration::from_millis(1), 0.10), @"\u{1b}[?25l\r 10% [█▊ ]\u{1b}[K"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this supposed to be changed by mitsuhiko/insta#715 ? If that's the case, it's probably better to merge this PR after new insta is released. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's also not very difficult to compile cargo-insta from source. I do it for mitsuhiko/insta#438.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, this is with mitsuhiko/insta#716 merged. The current logic is that if there are any bad control characters, then everything will be escaped. One could imagine another solution where even if there are unrenderable control characters, only they are escaped, and |
||
// No updates for the next 30 milliseconds | ||
assert_snapshot!(update(Duration::from_millis(10), 0.11), @""); | ||
assert_snapshot!(update(Duration::from_millis(10), 0.12), @""); | ||
|
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.
nit: It's not important that the trailing space is preserved here, but it looks a bit odd. We might have to add leading/trailing non-space character to the snapshot sample.
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.
You could also file a bug to
insta
. (Update: Thought I'm not 100% sure they would consider it a bug. See below for another possibility)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.
Perhaps a better option is to change the test (in a separate commit, like with inserting
allow_duplicates!
), so that we are in fact testing everything: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.
Yes. iirc, insta isn't strict about leading/trailing whitespaces, and I assume that's by design. I just pointed that out because this patch contained whitespace changes like this.
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.
What's weird is that it strips the whitespace at the end, but not at the start. I would have expected either both or neither.