From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- library/alloc/tests/linked_list.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 library/alloc/tests/linked_list.rs (limited to 'library/alloc/tests/linked_list.rs') 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)); +} -- cgit v1.2.3