()
| 1156 | |
| 1157 | #[test] |
| 1158 | fn test_file_ops_serialize_roundtrip() { |
| 1159 | let mut ops = FileOps::create( |
| 1160 | test_trunk_id(), |
| 1161 | "test.txt".to_string(), |
| 1162 | Some(Encoding::Utf8), |
| 1163 | ); |
| 1164 | ops.add_line_op(LineOps::insert( |
| 1165 | test_branch_id(0), |
| 1166 | None, |
| 1167 | vec![LeafOp::Insert { |
| 1168 | after: None, |
| 1169 | kind: TokenKind::Word, |
| 1170 | content: b"Hello".to_vec(), |
| 1171 | }], |
| 1172 | )); |
| 1173 | |
| 1174 | let json = serde_json::to_string(&ops).unwrap(); |
| 1175 | let deserialized: FileOps = serde_json::from_str(&json).unwrap(); |
| 1176 | |
| 1177 | assert_eq!(ops, deserialized); |
| 1178 | } |
| 1179 | |
| 1180 | #[test] |
| 1181 | fn test_line_ops_serialize_roundtrip() { |
nothing calls this directly
no test coverage detected