rust/src/test/run-pass/iter-contains.rs

11 lines
376 B
Rust
Raw Normal View History

fn main() {
2012-10-09 23:28:04 -05:00
assert [].contains(&22u) == false;
assert [1u, 3u].contains(&22u) == false;
assert [22u, 1u, 3u].contains(&22u) == true;
assert [1u, 22u, 3u].contains(&22u) == true;
assert [1u, 3u, 22u].contains(&22u) == true;
2012-09-25 19:39:22 -05:00
assert None.contains(&22u) == false;
assert Some(1u).contains(&22u) == false;
assert Some(22u).contains(&22u) == true;
}