Expose to JS

This commit is contained in:
Andras Schmelczer 2025-10-26 21:44:43 +00:00
commit 1b46e5d237
9 changed files with 95 additions and 17 deletions

View file

@ -46,7 +46,7 @@ fn test_merge_text_with_cursors() {
}
#[wasm_bindgen_test(unsupported = test)]
fn merge_binary() {
fn test_merge_binary() {
let left = [0, 1, 2];
let right = [3, 4, 5];
assert_eq!(
@ -62,6 +62,14 @@ fn test_is_binary() {
assert!(!is_binary(b"hello"));
}
#[wasm_bindgen_test(unsupported = test)]
fn test_get_compact_diff() {
let parent = "hello ";
let changed = "world";
let result = get_compact_diff(parent, &changed.into(), BuiltinTokenizer::Word);
assert_eq!(result, "{\"operations\":[-6,\"world\"],\"cursors\":[]}");
}
#[wasm_bindgen_test(unsupported = test)]
fn test_is_binary_empty() {
assert!(!is_binary(b""));