fix: list_dirs should return sorted results like list_files #21

Closed
opened 2026-05-25 17:50:05 +02:00 by michael · 1 comment
Owner

Problem

M.list_files returns a sorted list, M.list_dirs does not.
Callers expecting consistent behavior across both functions will
get different results.

Fix

Add table.sort(dirs) to M.list_dirs before returning.

## Problem `M.list_files` returns a sorted list, `M.list_dirs` does not. Callers expecting consistent behavior across both functions will get different results. ## Fix Add `table.sort(dirs)` to `M.list_dirs` before returning.
Author
Owner

table.sort(dirs) added to fs/dir.lua's list_dirs, matching list_files. Note: the existing test_fs.lua assertion was masking this bug by sorting the result itself before checking -- removed that redundant sort so the test actually verifies list_dirs' own ordering.

table.sort(dirs) added to fs/dir.lua's list_dirs, matching list_files. Note: the existing test_fs.lua assertion was masking this bug by sorting the result itself before checking -- removed that redundant sort so the test actually verifies list_dirs' own ordering.
michael 2026-07-19 17:55:40 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/daw-lua-common#21
No description provided.