Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/mpq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ int ListFiles(HANDLE hArchive, const std::string& listfileName, bool listAll, bo
// Default properties, if the user didn't specify any
"file-size", "locale", "file-time",
};
} else {
listDetailed = true; // If the user specified properties, we need to print the detailed output
}

// "Special" files are base files used by MPQ file format
Expand Down
32 changes: 0 additions & 32 deletions test/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,38 +109,6 @@ def test_list_mpq_with_specified_details(binary_path):
assert output_lines == expected_output, f"Unexpected output: {output_lines}"


def test_list_mpq_with_specified_details_but_no_detailed_flag(binary_path):
"""
Test MPQ file listing.

This test checks:
- That providing parameters to be listed does nothing if the -d/--detailed flag is not provided.
"""
script_dir = Path(__file__).parent
test_file = script_dir / "data" / "mpq_with_output_v1.mpq"

expected_output = {
"cats.txt",
"dogs.txt",
"bytes",
"(listfile)",
"(attributes)",
}

result = subprocess.run(
[str(binary_path), "list", "-a", str(test_file),
"-p", "hash-index", "-p", "flags", "-p", "encryption-key-raw", "-p", "encryption-key"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True
)

output_lines = set(result.stdout.splitlines())
assert len(result.stdout.splitlines()) == len(expected_output)
assert result.returncode == 0, f"mpqcli failed with error: {result.stderr}"
assert output_lines == expected_output, f"Unexpected output: {output_lines}"


def test_list_mpq_with_weak_signature(binary_path):
"""
Test MPQ file listing of MPQ with weak signature.
Expand Down