-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add diff algorithm * feat: implement DiffHook * feat: add rust/typescript API * feat: use u8 to enable SIMD * feat: add SIMD support * test: add a failed test case * revert: change to unicode index * fix: text event index correctness when using utf8 or unicode * fix: use unicode index * fix: apply delta * fix: remove splice_unicode --------- Co-authored-by: Zixuan Chen <[email protected]>
- Loading branch information
Showing
15 changed files
with
846 additions
and
146 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#![no_main] | ||
|
||
use libfuzzer_sys::fuzz_target; | ||
use loro::LoroDoc; | ||
|
||
fuzz_target!(|data: [&str; 3]| { | ||
let (old, new, new1) = (data[0], data[1], data[2]); | ||
let doc = LoroDoc::new(); | ||
let text = doc.get_text("text"); | ||
text.update(old); | ||
text.update(new); | ||
assert_eq!(&text.to_string(), new); | ||
text.update(new1); | ||
assert_eq!(&text.to_string(), new1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use loro::LoroDoc; | ||
|
||
#[test] | ||
fn update_text() { | ||
let doc = LoroDoc::new(); | ||
let text = doc.get_text("text"); | ||
text.update("ϼCCC"); | ||
text.update("2"); | ||
assert_eq!(&text.to_string(), "2"); | ||
} |
Oops, something went wrong.