()
| 1166 | |
| 1167 | #[test] |
| 1168 | fn test_multiple_hunks() { |
| 1169 | let mut change = Change::empty(ChangeHeader::new("Multiple hunks")); |
| 1170 | |
| 1171 | for i in 0..10 { |
| 1172 | let graph_op: GraphOp<Option<Hash>> = GraphOp::Edit { |
| 1173 | change: Atom::Insertion(Insertion { |
| 1174 | predecessors: vec![], |
| 1175 | successors: vec![], |
| 1176 | flag: EdgeFlags::BLOCK, |
| 1177 | start: ChangePosition::new(i * 10), |
| 1178 | end: ChangePosition::new((i + 1) * 10), |
| 1179 | inode: test_hash_position(0), |
| 1180 | }), |
| 1181 | local: Local::new("test.rs", i + 1), |
| 1182 | encoding: Some(Encoding::Utf8), |
| 1183 | }; |
| 1184 | change.add_hunk(graph_op); |
| 1185 | } |
| 1186 | |
| 1187 | let mut buffer = Vec::new(); |
| 1188 | change.serialize(&mut buffer).unwrap(); |
| 1189 | |
| 1190 | let mut cursor = Cursor::new(buffer); |
| 1191 | let (loaded, _) = Change::deserialize(&mut cursor).unwrap(); |
| 1192 | |
| 1193 | assert_eq!(loaded.hunks().len(), 10); |
| 1194 | } |
| 1195 | |
| 1196 | #[test] |
| 1197 | fn test_hash_stability() { |
nothing calls this directly
no test coverage detected