From 44e3e3e47ee212ce0e021384bc13d45e47386953 Mon Sep 17 00:00:00 2001 From: Alex Koshelev Date: Fri, 19 Jan 2024 12:16:53 -0800 Subject: [PATCH] Improve code coverage --- ipa-core/src/seq_join.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ipa-core/src/seq_join.rs b/ipa-core/src/seq_join.rs index f98ad2d36..accc595b4 100644 --- a/ipa-core/src/seq_join.rs +++ b/ipa-core/src/seq_join.rs @@ -600,6 +600,21 @@ mod test { }); } + #[test] + fn size() { + run(|| async { + let mut count = 10_usize; + let capacity = NonZeroUsize::new(3).unwrap(); + let mut values = seq_join(capacity, iter((0..count).map(|i| async move { i }))); + assert_eq!((count, Some(count)), values.size_hint()); + + while values.next().await.is_some() { + count -= 1; + assert_eq!((count, Some(count)), values.size_hint()); + } + }); + } + #[test] fn out_of_order() { run(|| async {