fix(filesystem): render root folder path correctly

This commit is contained in:
BukeLy 2026-05-26 16:21:57 +08:00
parent ec96812e6b
commit 8ae94ade19
2 changed files with 17 additions and 2 deletions

View file

@ -106,6 +106,17 @@ def test_find_maxdepth_zero_type_directory_returns_start_folder(tmp_path):
assert [row["path"] for row in rows] == ["/documents"]
def test_find_directory_output_renders_root_without_double_slash(tmp_path):
executor = _register_find_fixture(tmp_path)
executor.json_output = False
output = executor.execute("find / -maxdepth 1 -type d")
assert output.splitlines()[0] == "/ folders=1 files=0"
assert "//" not in output
assert "/documents/ folders=1 files=1" in output
def test_find_maxdepth_combines_with_where_and_limit(tmp_path):
executor = _register_find_fixture(tmp_path)