#![cfg(not(debug_assertions))]
use kevy_bench::{bench, black_box};
use kevy_ring::ring;
#[test]
fn push_pop_same_thread_under_budget() {
let (mut tx, mut rx) = ring::<u64>(256);
let s = bench(40, 100_000, || {
tx.push(black_box(7u64)).unwrap();
black_box(rx.pop());
});
assert!(
s.median_ns < 80,
"push+pop same-thread median = {} ns, budget 80",
s.median_ns
);
}
#[test]
fn capacity_is_power_of_two() {
let (tx, _rx) = ring::<u64>(100);
let c = tx.capacity();
assert!(c.is_power_of_two(), "capacity {c} not a power of two");
assert!(c >= 100);
}