rust/library/alloc/tests/linked_list.rs

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

22 lines
351 B
Rust
Raw Normal View History

use std::collections::LinkedList;
#[test]
fn test_hash() {
2019-02-02 03:14:40 -06:00
use crate::hash;
let mut x = LinkedList::new();
let mut y = LinkedList::new();
2019-02-02 03:14:40 -06:00
assert!(hash(&x) == hash(&y));
x.push_back(1);
x.push_back(2);
x.push_back(3);
y.push_front(3);
y.push_front(2);
y.push_front(1);
2019-02-02 03:14:40 -06:00
assert!(hash(&x) == hash(&y));
}