MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_side_by_side_changes

Function test_side_by_side_changes

atomic-core/src/diff/display.rs:935–948  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

933
934 #[test]
935 fn test_side_by_side_changes() {
936 let old = b"a\nb\nc\n";
937 let new = b"a\nx\nc\n";
938 let diff = SideBySideDiff::new(old, new, Algorithm::Myers);
939
940 let pairs: Vec<_> = diff.pairs().collect();
941
942 // First pair: unchanged
943 assert!(pairs[0].is_unchanged());
944
945 // Second pair: old has 'b', new has 'x' (or they're separate)
946 // The exact pairing depends on how Replace is handled
947 assert!(pairs.iter().any(|p| p.is_change()));
948 }
949
950 #[test]
951 fn test_diff_stats() {

Callers

nothing calls this directly

Calls 1

pairsMethod · 0.80

Tested by

no test coverage detected