mirror of
https://github.com/loro-dev/loro.git
synced 2025-01-22 21:07:43 +00:00
4f0d499d4b
* 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
10 lines
262 B
Rust
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");
|
|
}
|