diff options
Diffstat (limited to 'tests/basic.rs')
-rw-r--r-- | tests/basic.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/basic.rs b/tests/basic.rs index e3bc73c..897e912 100644 --- a/tests/basic.rs +++ b/tests/basic.rs @@ -141,8 +141,11 @@ fn test_which_re_in_with_matches() { .collect(); let temp = f.tempdir; - - assert_eq!(result, vec![temp.path().join("a/bin_0"), temp.path().join("b/bin_1")]) + + assert_eq!( + result, + vec![temp.path().join("a/bin_0"), temp.path().join("b/bin_1")] + ) } #[test] @@ -160,6 +163,15 @@ fn test_which_re_in_without_matches() { } #[test] +#[cfg(all(unix, feature = "regex"))] +fn test_which_re_accepts_owned_and_borrow() { + which::which_re(Regex::new(r".").unwrap()); + which::which_re(&Regex::new(r".").unwrap()); + which::which_re_in(Regex::new(r".").unwrap(), Some("pth")); + which::which_re_in(&Regex::new(r".").unwrap(), Some("pth")); +} + +#[test] #[cfg(unix)] fn test_which_extension() { let f = TestFixture::new(); |