diff --git a/src/mpq.cpp b/src/mpq.cpp index 287787d..a8114e3 100644 --- a/src/mpq.cpp +++ b/src/mpq.cpp @@ -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 diff --git a/test/test_list.py b/test/test_list.py index 49dfa4b..7e88ed1 100644 --- a/test/test_list.py +++ b/test/test_list.py @@ -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.