Lines Matching +full:- +full:- +full:bins
18 pub bins: Vec<PathBuf>, field
25 fn mk_bin(dir: &Path, path: &str, extension: &str) -> io::Result<PathBuf> { in mk_bin()
36 fn touch(dir: &Path, path: &str, extension: &str) -> io::Result<PathBuf> { in touch()
42 fn mk_bin(dir: &Path, path: &str, extension: &str) -> io::Result<PathBuf> { in mk_bin()
56 pub fn new() -> TestFixture { in new()
61 let mut bins = vec![]; in new() localVariable
65 bins.push(mk_bin(&p, BIN_NAME, "").unwrap()); in new()
66 bins.push(mk_bin(&p, BIN_NAME, "exe").unwrap()); in new()
67 bins.push(mk_bin(&p, BIN_NAME, "cmd").unwrap()); in new()
70 let p = tempdir.path().join("win-bin"); in new()
72 bins.push(mk_bin(&p, "win-bin", "exe").unwrap()); in new()
77 bins, in new()
82 pub fn touch(&self, path: &str, extension: &str) -> io::Result<PathBuf> { in touch()
86 pub fn mk_bin(&self, path: &str, extension: &str) -> io::Result<PathBuf> { in mk_bin()
91 fn _which<T: AsRef<OsStr>>(f: &TestFixture, path: T) -> which::Result<which::CanonicalPath> { in _which()
98 ) -> which::Result<impl Iterator<Item = which::Result<which::CanonicalPath>> + '_> { in _which_all()
123 assert_eq!(_which(&f, &BIN_NAME).unwrap(), f.bins[0]) in test_which()
130 assert_eq!(_which(&f, &BIN_NAME).unwrap(), f.bins[1]) in test_which()
190 assert_eq!(_which(&f, &b).unwrap(), f.bins[0]) in test_which_extension()
198 assert_eq!(_which(&f, &b).unwrap(), f.bins[2]) in test_which_extension()
205 let b = Path::new("win-bin"); in test_which_no_extension()
208 assert_eq!(which_result.extension(), f.bins[9].extension()); in test_which_no_extension()
209 assert_eq!(fs::canonicalize(&which_result).unwrap(), f.bins[9]) in test_which_no_extension()
233 .bins in test_which_all()
254 _which(&f, &f.bins[3]).unwrap(), in test_which_absolute()
255 f.bins[3].canonicalize().unwrap() in test_which_absolute()
264 _which(&f, &f.bins[4]).unwrap(), in test_which_absolute()
265 f.bins[4].canonicalize().unwrap() in test_which_absolute()
275 let p = &f.bins[4]; in test_which_absolute_path_case()
276 assert_eq!(_which(&f, &p).unwrap(), f.bins[4].canonicalize().unwrap()); in test_which_absolute_path_case()
284 let b = f.bins[3].parent().unwrap().join(&BIN_NAME); in test_which_absolute_extension()
285 assert_eq!(_which(&f, &b).unwrap(), f.bins[3].canonicalize().unwrap()); in test_which_absolute_extension()
293 let b = f.bins[4].parent().unwrap().join(&BIN_NAME); in test_which_absolute_extension()
294 assert_eq!(_which(&f, &b).unwrap(), f.bins[4].canonicalize().unwrap()); in test_which_absolute_extension()
303 f.bins[3].canonicalize().unwrap() in test_which_relative()
313 f.bins[4].canonicalize().unwrap() in test_which_relative()
324 assert_eq!(_which(&f, &b).unwrap(), f.bins[3].canonicalize().unwrap()); in test_which_relative_extension()
334 assert_eq!(_which(&f, &b).unwrap(), f.bins[5].canonicalize().unwrap()); in test_which_relative_extension()
344 assert_eq!(_which(&f, &b).unwrap(), f.bins[4].canonicalize().unwrap()); in test_which_relative_extension_case()
353 f.bins[3].canonicalize().unwrap() in test_which_relative_leading_dot()
363 f.bins[4].canonicalize().unwrap() in test_which_relative_leading_dot()
370 // Shouldn't return non-executable files. in test_which_non_executable()
379 // Shouldn't return non-executable files, even if given an absolute path. in test_which_absolute_non_executable()
388 // Shouldn't return non-executable files. in test_which_relative_non_executable()
398 let run = || -> which::Result<PathBuf> { in test_failure()