Skip to content

Commit

Permalink
RadixTree -> StrictRadixTree
Browse files Browse the repository at this point in the history
  • Loading branch information
voltrevo committed Aug 17, 2023
1 parent f59f68a commit 12382a6
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 81 deletions.
20 changes: 10 additions & 10 deletions radix_tree/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
mod radix_tree;
mod radix_tree_iterator;
mod strict_radix_tree;
mod strict_radix_tree_iterator;

pub use crate::radix_tree::RadixTree;
pub use crate::strict_radix_tree::StrictRadixTree;

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn empty_tree() {
let tree = RadixTree::<usize, 4>::new();
let tree = StrictRadixTree::<usize, 4>::new();
assert!(tree.is_empty());
assert_eq!(tree.len(), 0);
assert_eq!(tree.first(), None);
Expand All @@ -18,15 +18,15 @@ mod tests {

#[test]
fn push_once() {
let mut tree = RadixTree::<usize, 4>::new();
let mut tree = StrictRadixTree::<usize, 4>::new();
tree.push(0);
assert_eq!(tree.len(), 1);
assert!(!tree.is_empty());
}

#[test]
fn push_100() {
let mut tree = RadixTree::<usize, 4>::new();
let mut tree = StrictRadixTree::<usize, 4>::new();

for i in 0..100 {
tree.push(i);
Expand Down Expand Up @@ -57,7 +57,7 @@ mod tests {

#[test]
fn push_64() {
let mut tree = RadixTree::<usize, 4>::new();
let mut tree = StrictRadixTree::<usize, 4>::new();

for i in 0..64 {
tree.push(i);
Expand All @@ -77,7 +77,7 @@ mod tests {

#[test]
fn iters() {
let mut tree = RadixTree::<usize, 4>::new();
let mut tree = StrictRadixTree::<usize, 4>::new();

for i in 0..100 {
tree.push(i);
Expand All @@ -90,7 +90,7 @@ mod tests {

#[test]
fn pop_100() {
let mut tree = RadixTree::<usize, 4>::new();
let mut tree = StrictRadixTree::<usize, 4>::new();

for i in 0..100 {
tree.push(i);
Expand All @@ -109,7 +109,7 @@ mod tests {

#[test]
fn truncate() {
let mut tree = RadixTree::<usize, 4>::new();
let mut tree = StrictRadixTree::<usize, 4>::new();

for i in 0..100 {
tree.push(i);
Expand Down
Loading

0 comments on commit 12382a6

Please sign in to comment.