()
| 1712 | |
| 1713 | #[test] |
| 1714 | fn test_file_ops_serialize_roundtrip() { |
| 1715 | let mut ops = FileOps::create( |
| 1716 | test_trunk_id(), |
| 1717 | "test.txt".to_string(), |
| 1718 | Some(Encoding::Utf8), |
| 1719 | ); |
| 1720 | ops.add_line_op(LineOps::insert( |
| 1721 | test_branch_id(0), |
| 1722 | None, |
| 1723 | vec![LeafOp::Insert { |
| 1724 | after: None, |
| 1725 | kind: TokenKind::Word, |
| 1726 | content: b"Hello".to_vec(), |
| 1727 | }], |
| 1728 | )); |
| 1729 | |
| 1730 | let json = serde_json::to_string(&ops).unwrap(); |
| 1731 | let deserialized: FileOps = serde_json::from_str(&json).unwrap(); |
| 1732 | |
| 1733 | assert_eq!(ops, deserialized); |
| 1734 | } |
| 1735 | |
| 1736 | #[test] |
| 1737 | fn test_line_ops_serialize_roundtrip() { |
nothing calls this directly
no test coverage detected