Skip to content

Commit

Permalink
Add test for listing only directories (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
sighol authored Aug 29, 2024
1 parent 103fed6 commit 986ce7c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/tests/test_simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,26 @@ fn test_filter_txt_files() {

assert_eq!(expected, output);
}

#[test]
fn test_only_directories() {
let expected = r#"simple
└── yyy
├── k
├── s
└── zz
└── a
└── b
"#;
let (output, summary) = run_cmd(
Path::new("tests/simple"),
Config {
show_only_dirs: true,
..Default::default()
},
);

assert_eq!(expected, output);
assert_eq!(6, summary.num_folders);
assert_eq!(0, summary.num_files);
}

0 comments on commit 986ce7c

Please sign in to comment.