-
Notifications
You must be signed in to change notification settings - Fork 35
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
bug: indentify the bug with XMLDocument comparison #247
Conversation
@yegor256 Could you take a look, please? |
@volodya-lombrozo well, technically, these are two different documents. In XML, spaces are not ignored - they are part of the syntax. The following document:
Is parsed into:
I'm not sure jcabi-xml should ignore all spaces (which are |
@yegor256 , what if we add one more document type,
Moreover, I've faced with the same problem myself. I want to compare two XMLs indecently on their formatting. |
@yegor256 what do you think? |
@volodya-lombrozo I tried to reproduce the bug in 818f3ea, but failed. Can you suggest a unit test that will show the problem? |
@yegor256 Yes, you are right. My unit test doesn't reproduce the error. However, the integration test does. You can run it using the following command: mvn clean integration-test invoker:run -Dinvoker.test=groovy -DskipTests Does this test causes error in your environment? |
@yegor256 I tried to mimic the same code in Java: final File first = Paths.get("/absolute-path-to/first.xmir").toFile();
final File same = Paths.get("/absolute-path-to/same.xmir").toFile();
MatcherAssert.assertThat(
new XMLDocument(first),
Matchers.equalTo(new XMLDocument(same))
); And it passes successfully. Most probably, this problem is |
@yegor256, I have finally identified the problem. In the unit tests, we use I have demonstrated this case in the unit test. Could you please take a look one more time? |
@yegor256 What do you think? |
@rultor merge |
I have faced with the problem of
XMLDocument
comparison. If there are two similar documents, but with different formatting, they aren't equal to each other. For example:and
aren't equal
XMLDocuments
.In this PR I added:
XMLDocument
comparisonXMLDocument
in a Groovy script (the place where I originally have found the bug).