Bring the whole workspace into compliance with the repo's rustfmt config (edition 2024, max_width 100, use_small_heuristics = "Max"), which had drifted across many crates. Pure formatting — no logic changes; `cargo fmt --check` is now clean and `cargo build --workspace` is green.
17 lines
624 B
Rust
17 lines
624 B
Rust
use lawsynth_runner::{CancellationToken, Checkpoint, ProcessRecord};
|
|
|
|
#[test]
|
|
fn checkpoint_records_are_verified_and_monotonic() {
|
|
let mut record = ProcessRecord::new("work");
|
|
record.record_checkpoint(Checkpoint::new(1, 10, b"state-one".to_vec(), 64).unwrap()).unwrap();
|
|
assert_eq!(record.latest_checkpoint().unwrap().sequence, 1);
|
|
assert!(
|
|
record
|
|
.record_checkpoint(Checkpoint::new(1, 11, b"state-two".to_vec(), 64).unwrap())
|
|
.is_err()
|
|
);
|
|
let token = CancellationToken::default();
|
|
token.cancel("operator request").unwrap();
|
|
assert!(token.check().is_err());
|
|
}
|