main.rs 435 B

12345678910111213141516
  1. use lib_ot::core::{DocumentTree, NodeData, Position, TransactionBuilder};
  2. #[test]
  3. fn main() {
  4. // Create a new arena
  5. let _document = DocumentTree::new();
  6. }
  7. #[test]
  8. fn test_documents() {
  9. let mut document = DocumentTree::new();
  10. let mut tb = TransactionBuilder::new(&document);
  11. tb.insert_nodes(&Position(vec![0]), &vec![NodeData::new("type")]);
  12. let transaction = tb.finalize();
  13. document.apply(transaction);
  14. }