This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
test: make refs tests iteration order independent #2982
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposing here a change which will make the
refs.js
tests dag node iteration order independent by sorting the expected and actual refs list. In the soon-to-be polished rust-ipfs refs implementation the refs are iterated breadth-first. Looking at the js-ipfs implementation I am not 100% sure but looks like the implementation is recursive depth-first (I could be wrong).The iteration orders differ on almost half of the tests, but only big difference is with the test modified on the second commit: recursive+unique test with formatting
<linkname>
where a document has two names and breadth-first and depth-first offer the different names as a result.The proposed changes are similar to what is already done for the dag-cbor nodes (sorted).