Skip to content

test: remove superfluous tests #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,6 @@ use crate::{
split, ChunkRanges, ChunkRangesRef, ResponseIter,
};

/// Compute the blake3 hash for the given data,
///
/// using blake3_hash_inner which is used in hash_block.
fn blake3_hash(data: impl AsRef<[u8]>) -> blake3::Hash {
blake3::hash(data.as_ref())
}

fn bao_tree_blake3_impl(data: Vec<u8>) -> (blake3::Hash, blake3::Hash) {
let expected = blake3::hash(&data);
let actual = blake3_hash(&data);
(expected, actual)
}

/// Computes a reference pre order outboard using the bao crate (chunk_group_log = 0) and then flips it to a post-order outboard.
fn post_order_outboard_bao(data: &[u8]) -> PostOrderMemOutboard {
let mut outboard = Vec::new();
Expand Down Expand Up @@ -316,20 +303,6 @@ fn bao_tree_decode_slice_0() {
bao_tree_decode_slice_iter_impl(td(1024 * 17), 0..18);
}

#[test]
fn bao_tree_blake3_0() {
use make_test_data as td;
assert_tuple_eq!(bao_tree_blake3_impl(td(0)));
assert_tuple_eq!(bao_tree_blake3_impl(td(1)));
assert_tuple_eq!(bao_tree_blake3_impl(td(1023)));
assert_tuple_eq!(bao_tree_blake3_impl(td(1024)));
assert_tuple_eq!(bao_tree_blake3_impl(td(1025)));
assert_tuple_eq!(bao_tree_blake3_impl(td(2047)));
assert_tuple_eq!(bao_tree_blake3_impl(td(2048)));
assert_tuple_eq!(bao_tree_blake3_impl(td(2049)));
assert_tuple_eq!(bao_tree_blake3_impl(td(10000)));
}

#[test]
#[ignore]
fn outboard_from_level() {
Expand Down Expand Up @@ -1008,11 +981,6 @@ proptest! {
prop_assert_tuple_eq!(pre_order_iter_comparison_impl(len, level));
}

#[test]
fn bao_tree_blake3(data in proptest::collection::vec(any::<u8>(), 0..32768)) {
prop_assert_tuple_eq!(bao_tree_blake3_impl(data));
}

#[test]
fn bao_tree_encode_slice_all(len in 0..32768usize) {
let data = make_test_data(len);
Expand Down
Loading