mirror of https://github.com/sgoudham/bst-rs.git
FIX(docs, tests): Fix empty doctests, and add docs
* Adds documentation to the `bst!` macro * Changes the tree visualizations from `rust` blocks to just `text`, so that `cargo doc` does not complain * Runs `cargo fmt`pull/4/head
parent
63a3190084
commit
fdf7d1c8cf
@ -1,17 +1,17 @@
|
|||||||
use bst_rs::bst;
|
use bst_rs::{bst, BinarySearchTree, IterativeBST};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn successfully_construct_bst_from_macro() {
|
fn successfully_construct_bst_from_macro() {
|
||||||
let mut actual_bst = IterativeBST::new();
|
let mut actual_bst = IterativeBST::new();
|
||||||
actual_bst.insert(3);
|
actual_bst.insert(3);
|
||||||
actual_bst.insert(2);
|
actual_bst.insert(2);
|
||||||
let expected_bst = bst![3,2];
|
let expected_bst = bst![3, 2];
|
||||||
assert_eq!(actual_bst, expected_bst);
|
assert_eq!(actual_bst, expected_bst);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn verify_permutations_produce_same_tree() {
|
fn verify_permutations_produce_same_tree() {
|
||||||
let expected_bst = bst![2,3];
|
let actual_bst = bst![2, 3];
|
||||||
let expected_bst = bst![3,2];
|
let expected_bst = bst![3, 2];
|
||||||
assert_eq!(actual_bst, expected_bst);
|
assert_eq!(actual_bst, expected_bst);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue