Skip to content

test: five assertions print what they saw when they fail - #549

Merged
vyncint merged 3 commits into
vyncint:mainfrom
DevanshGang:fix/assertion-failure-messages
Sep 30, 2026
Merged

vyncint merged 3 commits into
vyncint:mainfrom
DevanshGang:fix/assertion-failure-messages

Conversation

@DevanshGang

Copy link
Copy Markdown
Contributor

What & why

Impoves the assertion failure message in five tests so that test failures provide clearer context and are easier to diagnose.

Closes #545

Checklist

  • Linked an issue (or explained above why none exists)
  • Tests added/updated for the change
  • cargo fmt --all and cargo clippy --workspace --all-targets --all-features are clean
  • All commits are signed off (git commit -s) — see CONTRIBUTING.md §5
  • No AI attribution trailers (no AI co-authors, "Generated with" footers, or bot identities) — see CONTRIBUTING.md §6
  • CHANGELOG.md updated under [Unreleased] (user-facing changes only)
  • Snapshot changes (if any) were reviewed with cargo insta review, not blind-accepted

Signed-off-by: Devansh Gangwar <devansh.gangwar@ad.infosys.com>
Devansh Gangwar and others added 2 commits September 30, 2026 18:52
Signed-off-by: Devansh Gangwar <devansh.gangwar@ad.infosys.com>
`{:?}` of `none.stdout`, a Vec<u8>, prints a list of byte values such as
[117, 115, 97, ...] instead of the text; it now goes through
String::from_utf8_lossy like the stderr assertion right below it. The
artifact test's timeout check prints `{err}`, as vyncint#545 suggested: the
Display form is the readable one, with the screen block and any query
note, where Debug is the struct.

Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
@vyncint vyncint changed the title Test : Improved Five assertion failure messages test: five assertions print what they saw when they fail Sep 30, 2026

@vyncint vyncint left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again! Four of the five were right as written, and binding the result to a variable before the matches! is exactly the shape the builder_validation and compat ones needed.

I pushed one commit on top. {:?} on none.stdout prints the Vec as byte values, [117, 115, 97, ...], rather than text, so it now goes through String::from_utf8_lossy like the stderr assertion right below it. And the timeout check prints {err}, as the issue suggested: the Display form is the readable one, with the screen block. I also retitled the PR to Conventional Commit form (test: …, no space before the colon), since the title becomes the commit subject on main. Merging.

@vyncint
vyncint merged commit d90def6 into vyncint:main Sep 30, 2026
16 checks passed
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.

test: five assertions fail without saying what they saw

2 participants