Fixing bug with listing unknown file with the details flag; adding tests #128
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.
Turns out that in PR #117 / #118, I introduced a regression. If you try to use
mpqcli list -adon an archive with unknown filenames in it, it will list each unknown file 32 times. This PR fixes the bug. 🙈Also adding tests for the list and extract command (basically adding tests for the code I added in #31, but back then there was no test suite).
In this PR is an MPQ without an internal listfile, for use by the tests. I don't know if you find bundling an MPQ like this to be an issue or not; I realize the other tests create or download MPQs as needed, but the only way to create an MPQ without internal listfiles involves changing the code to use
SFileCreateArchive2instead ofSFileCreateArchive. We thus can't create one from the tests on-the-fly. The alternative I guess would be to try to find a public stable URL with a small MPQ with no internal listfile, but I opted to spend my time on other things than search for such a thing. 🙃