2015-03-10 23:58:16 -05:00
|
|
|
use std::collections::LinkedList;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_hash() {
|
2019-02-02 03:14:40 -06:00
|
|
|
use crate::hash;
|
|
|
|
|
2016-05-22 13:27:13 -05:00
|
|
|
let mut x = LinkedList::new();
|
|
|
|
let mut y = LinkedList::new();
|
2015-03-10 23:58:16 -05:00
|
|
|
|
2019-02-02 03:14:40 -06:00
|
|
|
assert!(hash(&x) == hash(&y));
|
2015-03-10 23:58:16 -05:00
|
|
|
|
2016-05-22 13:27:13 -05:00
|
|
|
x.push_back(1);
|
|
|
|
x.push_back(2);
|
|
|
|
x.push_back(3);
|
2015-03-10 23:58:16 -05:00
|
|
|
|
2016-05-22 13:27:13 -05:00
|
|
|
y.push_front(3);
|
|
|
|
y.push_front(2);
|
|
|
|
y.push_front(1);
|
2015-03-10 23:58:16 -05:00
|
|
|
|
2019-02-02 03:14:40 -06:00
|
|
|
assert!(hash(&x) == hash(&y));
|
2015-03-10 23:58:16 -05:00
|
|
|
}
|