mirror of
https://github.com/lsd-rs/lsd.git
synced 2026-04-10 05:33:50 +02:00
add custom config file test
This commit is contained in:
committed by
Abin Simon
parent
e5a531778a
commit
bfc2bbdeae
@@ -551,3 +551,20 @@ fn test_upper_case_ext_icon_match() {
|
||||
.assert()
|
||||
.stdout(predicate::str::contains("\u{f410}"));
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[test]
|
||||
fn test_custom_config_file_parsing() {
|
||||
let dir = tempdir();
|
||||
dir.child("config.yaml").write_str("layout: tree").unwrap();
|
||||
dir.child("folder").create_dir_all().unwrap();
|
||||
dir.child("folder/file").touch().unwrap();
|
||||
let custom_config = dir.path().join("config.yaml");
|
||||
|
||||
cmd()
|
||||
.arg("--config-file")
|
||||
.arg(custom_config)
|
||||
.arg(dir.child("folder").path())
|
||||
.assert()
|
||||
.stdout(predicate::str::is_match("folder\n└── file").unwrap());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user