()
| 1915 | |
| 1916 | #[test] |
| 1917 | fn test_multiple_hunks() { |
| 1918 | let mut change = Change::empty(ChangeHeader::new("Multiple hunks")); |
| 1919 | |
| 1920 | for i in 0..10 { |
| 1921 | let graph_op: GraphOp<Option<Hash>> = GraphOp::Edit { |
| 1922 | change: Atom::Insertion(Insertion { |
| 1923 | predecessors: vec![], |
| 1924 | successors: vec![], |
| 1925 | flag: EdgeFlags::BLOCK, |
| 1926 | start: ChangePosition::new(i * 10), |
| 1927 | end: ChangePosition::new((i + 1) * 10), |
| 1928 | inode: test_hash_position(0), |
| 1929 | }), |
| 1930 | local: Local::new("test.rs", i + 1), |
| 1931 | encoding: Some(Encoding::Utf8), |
| 1932 | }; |
| 1933 | change.add_hunk(graph_op); |
| 1934 | } |
| 1935 | |
| 1936 | let mut buffer = Vec::new(); |
| 1937 | change.serialize(&mut buffer).unwrap(); |
| 1938 | |
| 1939 | let mut cursor = Cursor::new(buffer); |
| 1940 | let (loaded, _) = Change::deserialize(&mut cursor).unwrap(); |
| 1941 | |
| 1942 | assert_eq!(loaded.hunks().len(), 10); |
| 1943 | } |
| 1944 | |
| 1945 | #[test] |
| 1946 | fn test_hash_stability() { |
nothing calls this directly
no test coverage detected