2022-08-18 09:49:20 +00:00
|
|
|
use lib_ot::core::{DocumentTree, NodeData, Position, TransactionBuilder};
|
2021-12-15 15:01:50 +00:00
|
|
|
|
2022-08-16 08:25:52 +00:00
|
|
|
#[test]
|
|
|
|
fn main() {
|
|
|
|
// Create a new arena
|
|
|
|
let _document = DocumentTree::new();
|
|
|
|
}
|
2022-08-17 08:48:45 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_documents() {
|
2022-08-17 09:43:58 +00:00
|
|
|
let mut document = DocumentTree::new();
|
2022-08-18 09:49:20 +00:00
|
|
|
let mut tb = TransactionBuilder::new(&document);
|
|
|
|
tb.insert_nodes(&Position(vec![0]), &vec![NodeData::new("type")]);
|
2022-08-18 08:19:50 +00:00
|
|
|
let transaction = tb.finalize();
|
|
|
|
document.apply(transaction);
|
2022-08-17 08:48:45 +00:00
|
|
|
}
|