Skip to content

Commit 7ad27f7

Browse files
committed
fix(ls): add assertion for ancestor count
1 parent 26db61c commit 7ad27f7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/uu/ls/src/ls.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,13 @@ pub fn list(locs: Vec<&Path>, config: &Config) -> UResult<()> {
11441144
if config.dired && !config.hyperlink {
11451145
dired::print_dired_output(config, &dired, &mut state.out)?;
11461146
}
1147+
1148+
// Check all nodes are cleared after recursive listing in integration tests.
1149+
// FIXME: Turn into a proper test; integration testing most likely requires
1150+
// hard-linked directories, so it is a no-go. A unit test may be more
1151+
// feasible given a heavy refactor that decouples [`depth_first_list`].
1152+
debug_assert!(state.listed_ancestors.is_empty());
1153+
11471154
Ok(())
11481155
}
11491156

0 commit comments

Comments
 (0)