summary refs log tree commit diff
path: root/ripple
diff options
context:
space:
mode:
authoredef <edef@unfathomable.blue>2022-05-01 17:30:21 +0000
committeredef <edef@unfathomable.blue>2022-05-01 17:30:21 +0000
commita2c1815bc2bbd9ff6da3edf50f2e914d28eeff54 (patch)
treeee951a8f7c56e898023532608eb6fd4ba999d9a0 /ripple
parent52d504235d0e75994677d67213f196e58a5bb0e6 (diff)
downloadunf-legacy-a2c1815bc2bbd9ff6da3edf50f2e914d28eeff54.tar.zst
ripple/fossil/chunker: test early cutoff for <= MIN_CHUNK_SIZE
Full test coverage for Chunker::next!

Change-Id: I4f3dbad7e0a56f46d5714e0dd8e07f00ce255928
Diffstat (limited to 'ripple')
-rw-r--r--ripple/fossil/src/chunker/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/ripple/fossil/src/chunker/mod.rs b/ripple/fossil/src/chunker/mod.rs
index 108d5de..07b3e8d 100644
--- a/ripple/fossil/src/chunker/mod.rs
+++ b/ripple/fossil/src/chunker/mod.rs
@@ -196,4 +196,15 @@ mod test {
 			super::MIN_CHUNK_SIZE
 		);
 	}
+
+	#[test]
+	fn short_chunk() {
+		assert_eq!(
+			super::Chunker::from(&[0u8; super::MIN_CHUNK_SIZE / 2])
+				.next()
+				.unwrap()
+				.len(),
+			super::MIN_CHUNK_SIZE / 2
+		);
+	}
 }