Fix lint & tests
This commit is contained in:
parent
4c77a0360e
commit
b0ad819ac6
4 changed files with 23 additions and 10 deletions
|
|
@ -3,7 +3,7 @@ mod example_document;
|
|||
use std::{fs, path::Path};
|
||||
|
||||
use example_document::ExampleDocument;
|
||||
use reconcile_text::{BuiltinTokenizer, EditedText, reconcile};
|
||||
use reconcile_text::{BuiltinTokenizer, reconcile};
|
||||
use serde::Deserialize;
|
||||
|
||||
#[test]
|
||||
|
|
@ -37,6 +37,8 @@ fn test_document_one_way_with_cursors() {
|
|||
#[cfg(feature = "serde")]
|
||||
#[test]
|
||||
fn test_document_one_way_with_serialisation() {
|
||||
use reconcile_text::EditedText;
|
||||
|
||||
for doc in &get_all_documents() {
|
||||
let parent = doc.parent();
|
||||
let left_operations =
|
||||
|
|
|
|||
|
|
@ -59,8 +59,12 @@ fn test_merge_binary() {
|
|||
fn test_get_compact_diff() {
|
||||
let parent = "hello ";
|
||||
let changed = "world";
|
||||
|
||||
let result = get_compact_diff(parent, &changed.into(), BuiltinTokenizer::Word);
|
||||
|
||||
assert_eq!(result.len(), 2);
|
||||
assert_eq!(result[0].as_f64().unwrap(), -6.0);
|
||||
assert_eq!(result[1].as_string().unwrap(), "world");
|
||||
let first: i64 = result[0].clone().try_into().unwrap();
|
||||
let second: String = result[1].clone().try_into().unwrap();
|
||||
assert_eq!(first, -6);
|
||||
assert_eq!(second, "world");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue