Skip to content

Commit 68ba505

Browse files
authored
add a test for #301 (#302)
1 parent 7a59690 commit 68ba505

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

version-ranges/src/lib.rs

+11
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,17 @@ pub mod tests {
14011401
);
14021402
}
14031403

1404+
#[test]
1405+
fn contains_can_take_owned() {
1406+
let range: Ranges<Box<u8>> = Ranges::singleton(1);
1407+
let version = 1;
1408+
1409+
assert_eq!(range.contains(&Box::new(version)), range.contains(&version));
1410+
let range: Ranges<String> = Ranges::singleton(1.to_string());
1411+
let version = 1.to_string();
1412+
assert_eq!(range.contains(&version), range.contains("1"));
1413+
}
1414+
14041415
#[test]
14051416
fn simplify_can_take_owned() {
14061417
let range: Ranges<u8> = Ranges::singleton(1);

0 commit comments

Comments
 (0)