()
| 1515 | |
| 1516 | #[test] |
| 1517 | fn test_line_ops_serialize_roundtrip() { |
| 1518 | let ops = LineOps::insert( |
| 1519 | test_branch_id(0), |
| 1520 | Some(test_branch_id(1)), |
| 1521 | vec![ |
| 1522 | LeafOp::Insert { |
| 1523 | after: None, |
| 1524 | kind: TokenKind::Word, |
| 1525 | content: b"Hello".to_vec(), |
| 1526 | }, |
| 1527 | LeafOp::Delete { |
| 1528 | leaf: crate::crdt::LeafId::new(NodeId::new(1), 3), |
| 1529 | }, |
| 1530 | ], |
| 1531 | ); |
| 1532 | |
| 1533 | let json = serde_json::to_string(&ops).unwrap(); |
| 1534 | let deserialized: LineOps = serde_json::from_str(&json).unwrap(); |
| 1535 | |
| 1536 | assert_eq!(ops, deserialized); |
| 1537 | } |
| 1538 | |
| 1539 | #[test] |
| 1540 | fn test_file_ops_postcard_roundtrip() { |
nothing calls this directly
no test coverage detected