mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
17 lines
495 B
Rust
17 lines
495 B
Rust
use flowy_ot::{
|
|
attributes::{Attributes, AttributesBuilder},
|
|
delta::Delta,
|
|
operation::{OpBuilder, Operation, Retain},
|
|
};
|
|
|
|
#[test]
|
|
fn attribute_insert_merge_test() {
|
|
let mut delta = Delta::default();
|
|
delta.insert("123", Some(AttributesBuilder::new().bold().build()));
|
|
delta.insert("456", Some(AttributesBuilder::new().bold().build()));
|
|
assert_eq!(
|
|
r#"[{"insert":"123456","attributes":{"bold":"true"}}]"#,
|
|
serde_json::to_string(&delta).unwrap()
|
|
)
|
|
}
|