()
| 2163 | |
| 2164 | #[test] |
| 2165 | fn test_multiple_hunks() { |
| 2166 | let mut change = Change::empty(ChangeHeader::new("Multiple hunks")); |
| 2167 | |
| 2168 | for i in 0..10 { |
| 2169 | let graph_op: GraphOp<Option<Hash>> = GraphOp::Edit { |
| 2170 | change: Atom::Insertion(Insertion { |
| 2171 | predecessors: vec![], |
| 2172 | successors: vec![], |
| 2173 | flag: EdgeFlags::BLOCK, |
| 2174 | start: ChangePosition::new(i * 10), |
| 2175 | end: ChangePosition::new((i + 1) * 10), |
| 2176 | inode: test_hash_position(0), |
| 2177 | }), |
| 2178 | local: Local::new("test.rs", i + 1), |
| 2179 | encoding: Some(Encoding::Utf8), |
| 2180 | }; |
| 2181 | change.add_hunk(graph_op); |
| 2182 | } |
| 2183 | |
| 2184 | let mut buffer = Vec::new(); |
| 2185 | change.serialize(&mut buffer).unwrap(); |
| 2186 | |
| 2187 | let mut cursor = Cursor::new(buffer); |
| 2188 | let (loaded, _) = Change::deserialize(&mut cursor).unwrap(); |
| 2189 | |
| 2190 | assert_eq!(loaded.hunks().len(), 10); |
| 2191 | } |
| 2192 | |
| 2193 | #[test] |
| 2194 | fn test_hash_stability() { |
nothing calls this directly
no test coverage detected