Skip to content
Myr

Add test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by David Peter · parent 0b7febc · Browse files · 2 files+11 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−3 removed

  • tests:+8 added−0 removed
  • other:+3 added−3 removed

2 files+11 added−3 removed

modified:src/main.rs+3 added-3 removed
159 unmodified lines
160 } else if let Some(args) = matches.values_of("exec-batch") {161 Some(CommandTemplate::new_batch(args)?)162 } else if matches.is_present("list-details") {163 let color = matches.value_of("color").unwrap_or("auto");164 #[allow(unused)]164 let color_arg = ["--color=", color].concat();165166 #[allow(unused)]167 let gnu_ls = |command_name| {168 vec![169 command_name,170 "-l", // long listing format
50 unmodified lines
221 if gnu_ls_exists {222 gnu_ls("ls")223 } else {224 return Err(anyhow!(225 "'fd --list-details' is not supported on this platform."225 "'fd --list-details' is not supported on Windows unless GNU 'ls' is installed."226 ));227 }228 } else {229 return Err(anyhow!(230 "'fd --list-details' is not supported on Windows unless GNU 'ls' is installed."230 "'fd --list-details' is not supported on this platform."231 ));232 };233234 Some(CommandTemplate::new_batch(&cmd).unwrap())
165 unmodified lines
modified:tests/tests.rs+8 added
1556 unmodified lines
1557 &["", "test1/", "--exec", "echo", "{/.}"],1558 b"test_\xFEinvalid\n",1559 );1560}15611562#[test]1563fn test_list_details() {1564 let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);15651566 // Make sure we can execute 'fd --list-details' without any errors.1567 te.assert_success_and_get_output(".", &["--list-details"]);1568}