use crate::streaming::messenger_mux::peer_batcher::writer::{MIN_BATCH_CAP, batch_cap};
use crate::transports::tcp::framing::COALESCE_THRESHOLD;
#[test]
fn the_configured_cap_binds_when_it_is_the_smallest() {
assert_eq!(batch_cap(4096, usize::MAX), 4096);
}
#[test]
fn the_coalescing_threshold_binds_over_a_larger_configured_cap() {
assert_eq!(batch_cap(1 << 20, usize::MAX), COALESCE_THRESHOLD);
}
#[test]
fn a_transport_with_a_tight_eager_budget_binds_over_both() {
assert_eq!(batch_cap(60 * 1024, 8192), 8192);
assert_eq!(batch_cap(1 << 20, 8192), 8192);
}
#[test]
fn the_floor_survives_every_ceiling() {
assert_eq!(batch_cap(60 * 1024, 1), MIN_BATCH_CAP);
assert_eq!(batch_cap(0, usize::MAX), MIN_BATCH_CAP);
}