2021-09-27 15:23:23 +00:00
|
|
|
use crate::document::helper::{DocScript, DocumentTest};
|
|
|
|
|
|
|
|
#[actix_rt::test]
|
2021-09-28 07:29:29 +00:00
|
|
|
async fn edit_doc_insert_text() {
|
2021-09-27 15:23:23 +00:00
|
|
|
let test = DocumentTest::new().await;
|
2021-09-29 09:40:34 +00:00
|
|
|
test.run_scripts(vec![
|
|
|
|
DocScript::SendText(0, "abc"),
|
|
|
|
DocScript::SendText(3, "123"),
|
|
|
|
DocScript::SendText(6, "efg"),
|
|
|
|
DocScript::AssertClient(r#"[{"insert":"abc123efg\n"}]"#),
|
|
|
|
DocScript::AssertServer(r#"[{"insert":"abc123efg\n"}]"#),
|
|
|
|
])
|
|
|
|
.await;
|
2021-09-27 15:23:23 +00:00
|
|
|
}
|
2021-09-30 09:24:02 +00:00
|
|
|
|
|
|
|
#[actix_rt::test]
|
|
|
|
async fn edit_doc_insert_large_text() {
|
|
|
|
let test = DocumentTest::new().await;
|
|
|
|
|
|
|
|
test.run_scripts(vec![
|
|
|
|
DocScript::ConnectWs,
|
|
|
|
DocScript::SendText(0, "abc"),
|
|
|
|
DocScript::SendText(0, "abc"),
|
|
|
|
DocScript::SendText(0, "abc"),
|
|
|
|
DocScript::SendText(0, "abc"),
|
|
|
|
DocScript::SendText(0, "abc"),
|
|
|
|
DocScript::SendText(0, "abc"),
|
|
|
|
DocScript::SendText(0, "abc"),
|
|
|
|
DocScript::SendText(0, "abc"),
|
|
|
|
/* DocScript::AssertClient(r#"[{"insert":"abc123efg\n"}]"#),
|
|
|
|
* DocScript::AssertServer(r#"[{"insert":"abc123efg\n"}]"#), */
|
|
|
|
])
|
|
|
|
.await;
|
|
|
|
}
|