bpsm / edn-java

a reader for extensible data notation
Eclipse Public License 1.0
100 stars 24 forks source link

Fix flaky test PrinterTest#testPrettyPrinting #68

Closed hsiangawang closed 3 years ago

hsiangawang commented 3 years ago

The test PrinterTest#testPrettyPrinting compares the result of Printers.printString to a hard-coded string based on a specific order of entries in HashMap and HashSet. However, these classes do not guarantee that order, and the assertion can fail if the order differs.

The PR uses LinkedHashMap and LinkedHashSet to make the order and the string deterministic.

bpsm commented 3 years ago

Thanks! This looks good. I'll merge it to develop tomorrow.