17 lines
435 B
Rust
Raw Normal View History

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