Skip to content

Add handling for Ranges#267

Merged
jas14 merged 5 commits into
mainfrom
lucas/range-diff
Oct 22, 2024
Merged

Add handling for Ranges#267
jas14 merged 5 commits into
mainfrom
lucas/range-diff

Conversation

@lucaseras

Copy link
Copy Markdown
Contributor

Fix for #154

@jas14 jas14 self-assigned this Oct 21, 2024

@jas14 jas14 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is awesome, thanks @lucaseras !

On second thought, let's skip attempting to diff Range objects. As the test files show, because the diff is just (- expected) (+ actual), I don't think it adds any clarity to the failure message beyond what the inspection results already show.

The InspectionTreeBuilder is great and makes the output way more useful:

  1) blah blah
     Failure/Error: expect(r1).to eq(r2)

-       Expected #<Range:0x0000000100de8a18> to eq #<Range:0x0000000100de89f0>.
+       Expected 1..2 to eq 2..3.
:DataObject,
"super_diff/basic/inspection_tree_builders/data_object"
)
autoload :DateLike, "super_diff/basic/inspection_tree_builders/date_like"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@jas14

jas14 commented Oct 21, 2024

Copy link
Copy Markdown
Collaborator

Oh, and don't forget to add a CHANGELOG entry.

@jas14 jas14 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me besides the leftover OperationTreeBuilder autoload. I'll tack on a commit to remove that.

Thanks!

Comment thread lib/super_diff/basic/operation_tree_builders.rb Outdated
@jas14 jas14 enabled auto-merge (squash) October 22, 2024 17:42
@jas14 jas14 merged commit 9e13afc into main Oct 22, 2024
@jas14 jas14 deleted the lucas/range-diff branch October 22, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants