Revert oversimplifications
This commit is contained in:
parent
03856fe868
commit
5170bf02ca
1 changed files with 72 additions and 89 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#![cfg(feature = "wasm")]
|
||||
|
||||
use reconcile_text::{BuiltinTokenizer, CursorPosition, TextWithCursors, wasm::*};
|
||||
use reconcile_text::{BuiltinTokenizer, CursorPosition, EditedText, TextWithCursors, wasm::*};
|
||||
use wasm_bindgen_test::*;
|
||||
|
||||
#[wasm_bindgen_test(unsupported = test)]
|
||||
|
|
@ -55,6 +55,16 @@ fn test_merge_binary() {
|
|||
);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test(unsupported = test)]
|
||||
fn test_from_diff_rejects_oversized_lengths() {
|
||||
for length in [1_i64 << 32, -(1_i64 << 40), i64::MAX, i64::MIN] {
|
||||
let error = EditedText::from_diff("abc", vec![length.into()], &*BuiltinTokenizer::Word)
|
||||
.unwrap_err();
|
||||
|
||||
assert!(error.to_string().starts_with("Invalid diff:"));
|
||||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test] // JsValue isn't supported outside of wasm
|
||||
fn test_diff() {
|
||||
let parent = "hello ";
|
||||
|
|
|
|||
Loading…
Reference in a new issue