diff --git a/crates/lox-library/src/tests.rs b/crates/lox-library/src/tests.rs index 08482aa..428fcf1 100644 --- a/crates/lox-library/src/tests.rs +++ b/crates/lox-library/src/tests.rs @@ -394,6 +394,21 @@ fn test_open_invite() { assert!(bridgeline == bucket.0[0]); } + +#[test] +fn test_k_invites() { + let mut th = TestHarness::new(); + for i in 0..25 { + let _ = th.open_invite(); + if (i+1) % OPENINV_K != 0 { + assert!(th.bdb.current_k == (i+1)%OPENINV_K, "the current_k should be (i+1)%OPENINV_K"); + } else { + assert!(th.bdb.current_k == OPENINV_K, "the current_k should be OPENINV_K"); + + } + } +} + #[test] fn test_trust_promotion() { let mut th = TestHarness::new();