fix: Ignore empty nodes in AstNode::isomorphic_to_source
#480
No reviewers
Labels
No labels
Compat/Breaking
Kind
Bad merge
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
New language
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mergiraf/mergiraf#480
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "wetneb/fix_isomorphism"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When checking that our merged output is isomorphic to our internal tree (as a consistency check), it can be that isomorphism fails because one of the sides contains extra empty nodes.
I think it makes sense to filter out those nodes to avoid that.
WIP because it depends of #478.fix: Ignore empty nodes into WIP: fix: Ignore empty nodes inAstNode::isomorphic_to_source
AstNode::isomorphic_to_source
Not logically at least, I don't think? Unless it's the go.mod tests that revealed this issue, but still I think it would be to nice a have separate test for this..
Yes, the test I have included in
4c56d94338
is specific for this issue but uses a feature ofgo.mod
that requires #478 to be parsed in the first place.yes but that's an integration test -- I was wondering whether we could make just a unit test specifically for
AstNode::isomorphic_to_source
. Let me see if I can come up with something...Given that it's a method of
MergedTree
, it involves creating aMergedTree
instance… it would be great to be able to create those more easily for unit tests, but so far we've just being creating them by running the merge process, so it's not very far from an integration test.Fully agree!
Maybe at least add a README.md saying that that integration test also tests the case fixed by this PR, and link the PR -- I'm sure that whoever stumbles upon a regression in this will be very thankful^^
@ -406,0 +407,4 @@
MergedChild::Original(child) => {
!child.source.is_empty()
},
MergedChild::Merged(MergedTree::ExactTree { node, revisions, .. }) => {
maybe reorder these two match arms to keep all the
MergedChild::Merged
s together? Or you could put theMergedChild::Original
case as the very first, since theMergedChild::Merged
are roughly in the order of ascending complexity4c56d94338
toadefd0dc90
WIP: fix: Ignore empty nodes into fix: Ignore empty nodes inAstNode::isomorphic_to_source
AstNode::isomorphic_to_source
adefd0dc90
tobb0e1bacc2
Very nice!