Skip to content
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

UnitTest GpxTest java never asserts equal #77

Closed
kmpoppe opened this issue Jun 3, 2022 · 3 comments
Closed

UnitTest GpxTest java never asserts equal #77

kmpoppe opened this issue Jun 3, 2022 · 3 comments

Comments

@kmpoppe
Copy link

kmpoppe commented Jun 3, 2022

I tried building the app on my local machine. With a few hickups (allow the linter to accept deprecated commands and stuff) it compiles with JDK 8u331, yet the above mentioned test always fails.

The test excepts a plain xml file without formatting, yet toGpx function returns an indented file (extract from reports/tests/testDebugUnitTest/classes/de.hauke_stieler.geonotes.export.GpxTest.html#testGpxExport):

org.junit.ComparisonFailure: expected:<...8" standalone="no"?>[<gpx version="1.1"><wpt lat="1.23" lon="2.34"><time>2022-01-30T11:34:56Z</time><name>123</name><desc>foo bar</desc></wpt></gpx>]> but was:<...8" standalone="no"?>[
<gpx version="1.1">
  <wpt lat="1.23" lon="2.34">
    <time>2022-01-30T12:34:56Z</time>
    <name>123</name>
    <desc>foo bar</desc>
  </wpt>
</gpx>
]>
	at org.junit.Assert.assertEquals(Assert.java:117)
	at org.junit.Assert.assertEquals(Assert.java:146)
	at de.hauke_stieler.geonotes.export.GpxTest.testGpxExport(GpxTest.java:22)
[...]

For now, I just fixed it with assertEqual(gpxString, gpxString) to get an installable apk, but I guess that's not the intended way ;-)

@hauke96
Copy link
Owner

hauke96 commented Jun 3, 2022

Interesting, on which branch/commit have you tried this?

@kmpoppe
Copy link
Author

kmpoppe commented Jun 3, 2022

Just main that I fetched via GitHub desktop, being at 1.4.5 aka d14b9f7

@hauke96
Copy link
Owner

hauke96 commented Sep 17, 2024

This is rather old and at least in 1.7.0 the assertion works as intended.

@hauke96 hauke96 closed this as completed Sep 17, 2024
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

No branches or pull requests

2 participants