()
| 1492 | |
| 1493 | #[test] |
| 1494 | fn test_file_ops_serialize_roundtrip() { |
| 1495 | let mut ops = FileOps::create( |
| 1496 | test_trunk_id(), |
| 1497 | "test.txt".to_string(), |
| 1498 | Some(Encoding::Utf8), |
| 1499 | ); |
| 1500 | ops.add_line_op(LineOps::insert( |
| 1501 | test_branch_id(0), |
| 1502 | None, |
| 1503 | vec![LeafOp::Insert { |
| 1504 | after: None, |
| 1505 | kind: TokenKind::Word, |
| 1506 | content: b"Hello".to_vec(), |
| 1507 | }], |
| 1508 | )); |
| 1509 | |
| 1510 | let json = serde_json::to_string(&ops).unwrap(); |
| 1511 | let deserialized: FileOps = serde_json::from_str(&json).unwrap(); |
| 1512 | |
| 1513 | assert_eq!(ops, deserialized); |
| 1514 | } |
| 1515 | |
| 1516 | #[test] |
| 1517 | fn test_line_ops_serialize_roundtrip() { |
nothing calls this directly
no test coverage detected