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

Group Equality Should Merge Adjacent Text/CDATA Nodes #18

Closed
djspiewak opened this Issue May 13, 2011 · 1 comment

Comments

Projects
None yet
1 participant
@djspiewak
Owner

djspiewak commented May 13, 2011

Consider the following spec:

forAll { (left: String, right: String) =>
  Group(Text(left), Text(right)) mustEqual Group(Text(left + right))
}

This is a very commonly-hit gotcha in scala.xml.

@djspiewak

This comment has been minimized.

Show comment
Hide comment
@djspiewak

djspiewak May 14, 2011

Owner

On further thought, it occurred to me that we probably don't want to make Group#equals quite this inefficient. Also, it might be a little surprising if equals were to take liberties with the internal data. So instead of modifying equals, I've added a canonicalize method to the Group class. Thus, users must be explicit about their desire to avoid these issues.

Owner

djspiewak commented May 14, 2011

On further thought, it occurred to me that we probably don't want to make Group#equals quite this inefficient. Also, it might be a little surprising if equals were to take liberties with the internal data. So instead of modifying equals, I've added a canonicalize method to the Group class. Thus, users must be explicit about their desire to avoid these issues.

@djspiewak djspiewak closed this May 14, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment