From 6b24f0d4fc5fe5dfc43ef4b8cd00c95563be7a89 Mon Sep 17 00:00:00 2001 From: Ivan Akimov Date: Sun, 10 Sep 2023 18:33:00 -0500 Subject: [PATCH] removing uniques test, part of spec algo testing --- tests/uniques.rs | 66 ------------------------------------------------ 1 file changed, 66 deletions(-) delete mode 100644 tests/uniques.rs diff --git a/tests/uniques.rs b/tests/uniques.rs deleted file mode 100644 index b1e029d..0000000 --- a/tests/uniques.rs +++ /dev/null @@ -1,66 +0,0 @@ -use sqids::*; -use std::collections::HashSet; - -const UPPER: u64 = 1_000; - -#[test] -fn uniques_with_padding() { - let sqids = - Sqids::new(Some(Options::new(None, Some(Options::default().alphabet.len() as u8), None))) - .unwrap(); - let mut set = HashSet::new(); - - for i in 0..UPPER { - let numbers = vec![i]; - let id = sqids.encode(&numbers).unwrap(); - set.insert(id.clone()); - assert_eq!(sqids.decode(&id), numbers); - } - - assert_eq!(set.len(), UPPER as usize); -} - -#[test] -fn uniques_low_ranges() { - let sqids = Sqids::default(); - let mut set = HashSet::new(); - - for i in 0..UPPER { - let numbers = vec![i]; - let id = sqids.encode(&numbers).unwrap(); - set.insert(id.clone()); - assert_eq!(sqids.decode(&id), numbers); - } - - assert_eq!(set.len(), UPPER as usize); -} - -#[test] -fn uniques_high_ranges() { - let sqids = Sqids::default(); - let mut set = HashSet::new(); - - for i in 100_000_000..100_000_000 + UPPER { - let numbers = vec![i]; - let id = sqids.encode(&numbers).unwrap(); - set.insert(id.clone()); - assert_eq!(sqids.decode(&id), numbers); - } - - assert_eq!(set.len(), UPPER as usize); -} - -#[test] -fn uniques_multi() { - let sqids = Sqids::default(); - let mut set = HashSet::new(); - - for i in 0..UPPER { - let numbers = vec![i, i, i, i, i]; - let id = sqids.encode(&numbers).unwrap(); - set.insert(id.clone()); - assert_eq!(sqids.decode(&id), numbers); - } - - assert_eq!(set.len(), UPPER as usize); -}