loro/crates/fuzz/tests/update_text.rs
Zixuan Chen 4f0d499d4b
perf: use a priority-queue-based search for updating text (#544)
* perf: use a priority-queue-based search for updating text

It tends to produce diffs with more continuous edits,
which is more efficient when we need to apply them to CRDTs

* fix: use better text diff calc

* refactor: add text update options struct

* chore: update text.update comments

* chore: fix warnings

* fix: rm a dumb optimization
2024-11-09 16:35:15 +08:00

10 lines
262 B
Rust

use loro::LoroDoc;
#[test]
fn update_text() {
let doc = LoroDoc::new();
let text = doc.get_text("text");
text.update("ϼCCC", Default::default()).unwrap();
text.update("2", Default::default()).unwrap();
assert_eq!(&text.to_string(), "2");
}