Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bao-tree"
version = "0.11.0"
version = "0.11.1"
authors = ["Rüdiger Klaehn <rklaehn@protonmail.com>"]
description = "BLAKE3 verfiied streaming with custom chunk groups and range set queries"
license = "MIT OR Apache-2.0"
Expand Down
11 changes: 10 additions & 1 deletion src/tests2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ fn valid_ranges_sync(outboard: &PostOrderMemOutboard) -> ChunkRanges {

/// range is a range of chunks. Just using u64 for convenience in tests
#[cfg(feature = "validate")]
fn valid_ranges_fsm(outboard: &mut PostOrderMemOutboard, data: Bytes) -> ChunkRanges {
fn valid_ranges_fsm(outboard: impl crate::io::fsm::Outboard, data: Bytes) -> ChunkRanges {
futures::executor::block_on(async move {
let ranges = ChunkRanges::all();
let mut stream = crate::io::fsm::valid_ranges(outboard, data, &ranges);
Expand Down Expand Up @@ -483,6 +483,15 @@ fn validate_fsm_neg_cases() {
}
}

#[test]
fn validate_bug() {
let data = Bytes::from(make_test_data(19308432));
let outboard = PostOrderMemOutboard::create(&data, BlockSize(4));
let expected = ChunkRanges::from(..ByteNum(data.len() as u64).chunks());
let actual = valid_ranges_fsm(outboard, data.clone());
assert_eq!(expected, actual);
}

/// Encode data fully, decode it again, and check that both data and outboard are the same
///
/// using the sync io api
Expand Down