Lint & format
This commit is contained in:
parent
9da05c6ff6
commit
48f301d8ab
9 changed files with 54 additions and 57 deletions
|
|
@ -66,11 +66,9 @@ impl ExampleDocument {
|
|||
result.insert(
|
||||
result
|
||||
.char_indices()
|
||||
.skip(cursor.char_index + i)
|
||||
.next()
|
||||
.map(|(byte_index, _)| byte_index)
|
||||
.unwrap_or_else(|| result.len()), /* find the utf8 char index of the insert
|
||||
* in byte index */
|
||||
.nth(cursor.char_index + i)
|
||||
.map_or_else(|| result.len(), |(byte_index, _)| byte_index), /* find the utf8 char index of the insert
|
||||
* in byte index */
|
||||
'|',
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,46 +8,46 @@ use serde::Deserialize;
|
|||
|
||||
#[test]
|
||||
fn test_document_one_way_without_cursors() {
|
||||
get_all_documents().iter().for_each(|doc| {
|
||||
for doc in &get_all_documents() {
|
||||
doc.assert_eq_without_cursors(&reconcile(
|
||||
&doc.parent(),
|
||||
&doc.left().text,
|
||||
&doc.right().text,
|
||||
))
|
||||
});
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_document_one_way_with_cursors() {
|
||||
get_all_documents().iter().for_each(|doc| {
|
||||
for doc in &get_all_documents() {
|
||||
doc.assert_eq(&reconcile_with_cursors(
|
||||
&doc.parent(),
|
||||
doc.left(),
|
||||
doc.right(),
|
||||
))
|
||||
});
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_document_inverse_way_without_cursors() {
|
||||
get_all_documents().iter().for_each(|doc| {
|
||||
for doc in &get_all_documents() {
|
||||
doc.assert_eq_without_cursors(&reconcile(
|
||||
&doc.parent(),
|
||||
&doc.right().text,
|
||||
&doc.left().text,
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_document_inverse_way_with_cursors() {
|
||||
get_all_documents().iter().for_each(|doc| {
|
||||
for doc in &get_all_documents() {
|
||||
doc.assert_eq(&reconcile_with_cursors(
|
||||
&doc.parent(),
|
||||
doc.right(),
|
||||
doc.left(),
|
||||
))
|
||||
});
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
fn get_all_documents() -> Vec<ExampleDocument> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue