Skip to content

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Sep 20, 2024

Our previous output tests asserted on the exact token stream, which is sensitive to subtle differences like > > vs >> in type signatures. With this change, we instead test for string equality after performing a pretty-printing pass, which has the effect of normalizing most such differences, thus making our tests more robust and less sensitive to these inconsequential syntax details.

@joshlf joshlf requested a review from jswrenn September 20, 2024 21:27
@joshlf joshlf enabled auto-merge September 20, 2024 21:27
@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.79%. Comparing base (ba8bf1c) to head (0a21c86).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1711      +/-   ##
==========================================
- Coverage   88.98%   88.79%   -0.20%     
==========================================
  Files          16       16              
  Lines        5830     5843      +13     
==========================================
  Hits         5188     5188              
- Misses        642      655      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if expect != res {
let diff = dissimilar::diff(&expect, &res)
.into_iter()
.map(|chunk| {
Copy link
Member

Choose a reason for hiding this comment

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

Per CI failures, use flat_map here

Our previous output tests asserted on the exact token stream, which is
sensitive to subtle differences like `> >` vs `>>` in type signatures.
With this change, we instead test for string equality *after* performing
a pretty-printing pass, which has the effect of normalizing most such
differences, thus making our tests more robust and less sensitive to
these inconsequential syntax details.
@joshlf joshlf force-pushed the derive-test-output-diff branch from 96095cb to 0a21c86 Compare September 20, 2024 22:57
@joshlf joshlf added this pull request to the merge queue Sep 20, 2024
Merged via the queue into main with commit 2230307 Sep 20, 2024
@joshlf joshlf deleted the derive-test-output-diff branch September 20, 2024 23:34
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.

4 participants