rust/tests/ui/stdlib-unit-tests/seq-compare.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
648 B
Rust
Raw Normal View History

// run-pass
pub fn main() {
2014-05-25 10:10:11 +00:00
assert!(("hello".to_string() < "hellr".to_string()));
assert!(("hello ".to_string() > "hello".to_string()));
assert!(("hello".to_string() != "there".to_string()));
assert!((vec![1, 2, 3, 4] > vec![1, 2, 3]));
assert!((vec![1, 2, 3] < vec![1, 2, 3, 4]));
assert!((vec![1, 2, 4, 4] > vec![1, 2, 3, 4]));
assert!((vec![1, 2, 3, 4] < vec![1, 2, 4, 4]));
assert!((vec![1, 2, 3] <= vec![1, 2, 3]));
assert!((vec![1, 2, 3] <= vec![1, 2, 3, 3]));
assert!((vec![1, 2, 3, 4] > vec![1, 2, 3]));
assert_eq!(vec![1, 2, 3], vec![1, 2, 3]);
assert!((vec![1, 2, 3] != vec![1, 1, 3]));
}