huskies: merge 826

This commit is contained in:
dave
2026-04-29 00:16:40 +00:00
parent 89bf4ae0cf
commit 6f30815b64
4 changed files with 58 additions and 127 deletions
@@ -1,8 +1,9 @@
//! Integration tests that replay the Kleppmann editing trace to validate list-CRDT correctness and performance.
use bft_json_crdt::keypair::make_author;
use bft_json_crdt::list_crdt::ListCrdt;
use bft_json_crdt::op::{OpId, ROOT_ID};
use std::{fs::File, io::Read};
use time::PreciseTime;
use std::{fs::File, io::Read, time::Instant};
use serde::Deserialize;
@@ -47,7 +48,7 @@ fn test_editing_trace() {
let mut list = ListCrdt::<char>::new(make_author(1), vec![]);
let mut ops: Vec<OpId> = Vec::new();
ops.push(ROOT_ID);
let start = PreciseTime::now();
let start = Instant::now();
let edits = t.edits;
for (i, op) in edits.into_iter().enumerate() {
let origin = ops[op.pos];
@@ -61,17 +62,13 @@ fn test_editing_trace() {
match i {
10_000 | 100_000 => {
let end = PreciseTime::now();
let runtime_sec = start.to(end);
println!("took {runtime_sec:?} to run {i} ops");
println!("took {:?} to run {i} ops", start.elapsed());
}
_ => {}
};
}
let end = PreciseTime::now();
let runtime_sec = start.to(end);
println!("took {runtime_sec:?} to finish");
println!("took {:?} to finish", start.elapsed());
let result = list.iter().collect::<String>();
let expected = t.final_text;
assert_eq!(result.len(), expected.len());