summaryrefslogtreecommitdiffstats
path: root/library/alloc/tests/linked_list.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/alloc/tests/linked_list.rs')
-rw-r--r--library/alloc/tests/linked_list.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/library/alloc/tests/linked_list.rs b/library/alloc/tests/linked_list.rs
new file mode 100644
index 000000000..65b09cb00
--- /dev/null
+++ b/library/alloc/tests/linked_list.rs
@@ -0,0 +1,21 @@
+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));
+}