Skip to main content

assert_checkpoint_count

Function assert_checkpoint_count 

Source
pub async fn assert_checkpoint_count(
    calls: &Arc<Mutex<Vec<CheckpointCall>>>,
    expected: usize,
)
Expand description

Assert the exact number of checkpoint calls made.

§Panics

Panics if the actual count doesn’t match expected.

§Examples

use durable_lambda_testing::prelude::*;

let (mut ctx, calls, _ops) = MockDurableContext::new()
    .with_step_result("s1", r#"1"#)
    .build()
    .await;

// replay step — no checkpoints
let _: Result<i32, String> = ctx.step("s1", || async { Ok(0) }).await.unwrap();

assert_checkpoint_count(&calls, 0).await;