mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
22 lines
351 B
Rust
22 lines
351 B
Rust
use std::collections::LinkedList;
|
|
|
|
#[test]
|
|
fn test_hash() {
|
|
use crate::hash;
|
|
|
|
let mut x = LinkedList::new();
|
|
let mut y = LinkedList::new();
|
|
|
|
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);
|
|
|
|
assert!(hash(&x) == hash(&y));
|
|
}
|