Skip to content

Commit

Permalink
add a test for #301
Browse files Browse the repository at this point in the history
  • Loading branch information
Eh2406 committed Dec 26, 2024
1 parent 7a59690 commit 067dda4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions version-ranges/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,17 @@ pub mod tests {
);
}

#[test]
fn contains_can_take_owned() {
let range: Ranges<Box<u8>> = Ranges::singleton(1);
let version = 1;

assert_eq!(range.contains(&Box::new(version)), range.contains(&version));
let range: Ranges<String> = Ranges::singleton(1.to_string());
let version = 1.to_string();
assert_eq!(range.contains(&version), range.contains("1"));
}

#[test]
fn simplify_can_take_owned() {
let range: Ranges<u8> = Ranges::singleton(1);
Expand Down

0 comments on commit 067dda4

Please sign in to comment.