|
@@ -1,11 +1,11 @@
|
|
use crate::editor::{TestBuilder, TestOp::*};
|
|
use crate::editor::{TestBuilder, TestOp::*};
|
|
-use flowy_collaboration::document::{FlowyDoc, PlainDoc, RECORD_THRESHOLD};
|
|
|
|
|
|
+use flowy_collaboration::document::{NewlineDoc, PlainDoc, RECORD_THRESHOLD};
|
|
use lib_ot::core::{Interval, NEW_LINE, WHITESPACE};
|
|
use lib_ot::core::{Interval, NEW_LINE, WHITESPACE};
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
fn history_insert_undo() {
|
|
fn history_insert_undo() {
|
|
let ops = vec![Insert(0, "123", 0), Undo(0), AssertDocJson(0, r#"[{"insert":"\n"}]"#)];
|
|
let ops = vec![Insert(0, "123", 0), Undo(0), AssertDocJson(0, r#"[{"insert":"\n"}]"#)];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -19,7 +19,7 @@ fn history_insert_undo_with_lagging() {
|
|
Undo(0),
|
|
Undo(0),
|
|
AssertDocJson(0, r#"[{"insert":"\n"}]"#),
|
|
AssertDocJson(0, r#"[{"insert":"\n"}]"#),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -32,7 +32,7 @@ fn history_insert_redo() {
|
|
Redo(0),
|
|
Redo(0),
|
|
AssertDocJson(0, r#"[{"insert":"123\n"}]"#),
|
|
AssertDocJson(0, r#"[{"insert":"123\n"}]"#),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -51,7 +51,7 @@ fn history_insert_redo_with_lagging() {
|
|
Undo(0),
|
|
Undo(0),
|
|
AssertDocJson(0, r#"[{"insert":"123\n"}]"#),
|
|
AssertDocJson(0, r#"[{"insert":"123\n"}]"#),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -62,7 +62,7 @@ fn history_bold_undo() {
|
|
Undo(0),
|
|
Undo(0),
|
|
AssertDocJson(0, r#"[{"insert":"\n"}]"#),
|
|
AssertDocJson(0, r#"[{"insert":"\n"}]"#),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -74,7 +74,7 @@ fn history_bold_undo_with_lagging() {
|
|
Undo(0),
|
|
Undo(0),
|
|
AssertDocJson(0, r#"[{"insert":"123\n"}]"#),
|
|
AssertDocJson(0, r#"[{"insert":"123\n"}]"#),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -87,7 +87,7 @@ fn history_bold_redo() {
|
|
Redo(0),
|
|
Redo(0),
|
|
AssertDocJson(0, r#" [{"insert":"123","attributes":{"bold":"true"}},{"insert":"\n"}]"#),
|
|
AssertDocJson(0, r#" [{"insert":"123","attributes":{"bold":"true"}},{"insert":"\n"}]"#),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -101,7 +101,7 @@ fn history_bold_redo_with_lagging() {
|
|
Redo(0),
|
|
Redo(0),
|
|
AssertDocJson(0, r#"[{"insert":"123","attributes":{"bold":"true"}},{"insert":"\n"}]"#),
|
|
AssertDocJson(0, r#"[{"insert":"123","attributes":{"bold":"true"}},{"insert":"\n"}]"#),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -133,7 +133,7 @@ fn history_delete_undo_2() {
|
|
Undo(0),
|
|
Undo(0),
|
|
AssertDocJson(0, r#"[{"insert":"\n"}]"#),
|
|
AssertDocJson(0, r#"[{"insert":"\n"}]"#),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -160,7 +160,7 @@ fn history_delete_undo_with_lagging() {
|
|
"#,
|
|
"#,
|
|
),
|
|
),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -174,7 +174,7 @@ fn history_delete_redo() {
|
|
Redo(0),
|
|
Redo(0),
|
|
AssertDocJson(0, r#"[{"insert":"\n"}]"#),
|
|
AssertDocJson(0, r#"[{"insert":"\n"}]"#),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -193,7 +193,7 @@ fn history_replace_undo() {
|
|
Undo(0),
|
|
Undo(0),
|
|
AssertDocJson(0, r#"[{"insert":"\n"}]"#),
|
|
AssertDocJson(0, r#"[{"insert":"\n"}]"#),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -214,7 +214,7 @@ fn history_replace_undo_with_lagging() {
|
|
Undo(0),
|
|
Undo(0),
|
|
AssertDocJson(0, r#"[{"insert":"123","attributes":{"bold":"true"}},{"insert":"\n"}]"#),
|
|
AssertDocJson(0, r#"[{"insert":"123","attributes":{"bold":"true"}},{"insert":"\n"}]"#),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -233,7 +233,7 @@ fn history_replace_redo() {
|
|
"#,
|
|
"#,
|
|
),
|
|
),
|
|
];
|
|
];
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -252,7 +252,7 @@ fn history_header_added_undo() {
|
|
),
|
|
),
|
|
];
|
|
];
|
|
|
|
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -271,7 +271,7 @@ fn history_link_added_undo() {
|
|
),
|
|
),
|
|
];
|
|
];
|
|
|
|
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -290,7 +290,7 @@ fn history_link_auto_format_undo_with_lagging() {
|
|
AssertDocJson(0, r#"[{"insert":"https://appflowy.io\n"}]"#),
|
|
AssertDocJson(0, r#"[{"insert":"https://appflowy.io\n"}]"#),
|
|
];
|
|
];
|
|
|
|
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -313,7 +313,7 @@ fn history_bullet_undo() {
|
|
),
|
|
),
|
|
];
|
|
];
|
|
|
|
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -341,7 +341,7 @@ fn history_bullet_undo_with_lagging() {
|
|
),
|
|
),
|
|
];
|
|
];
|
|
|
|
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
@@ -368,5 +368,5 @@ fn history_undo_attribute_on_merge_between_line() {
|
|
),
|
|
),
|
|
];
|
|
];
|
|
|
|
|
|
- TestBuilder::new().run_scripts::<FlowyDoc>(ops);
|
|
|
|
|
|
+ TestBuilder::new().run_scripts::<NewlineDoc>(ops);
|
|
}
|
|
}
|