Skip to content

Commit

Permalink
test: fix linked_hash_set test relying on random state (#950)
Browse files Browse the repository at this point in the history
  • Loading branch information
doitian authored Jun 5, 2019
1 parent 234d52d commit c38856c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions util/src/linked_hash_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ impl<K> ExactSizeIterator for IntoIter<K> {
mod tests {
use super::*;
use numext_fixed_hash::{h256, H256};
use std::collections::HashSet as StdHashSet;

#[test]
fn insertion_order() {
Expand All @@ -205,12 +204,6 @@ mod tests {

let txs = vec![tx1, tx2, tx3, tx4, tx5, tx6];

let mut std_set = StdHashSet::new();
std_set.extend(txs.iter().cloned());
// std hashset do not keep insertion order
let diff: Vec<H256> = std_set.difference(&StdHashSet::new()).cloned().collect();
assert!(txs != diff);

let mut set = LinkedHashSet::default();
set.extend(txs.iter().cloned());
let diff: Vec<H256> = set.difference(&LinkedHashSet::default()).cloned().collect();
Expand Down

0 comments on commit c38856c

Please sign in to comment.