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

Function test_hunks_modify_pair_offsets

atomic-cli/src/commands/diff/tests.rs:847–858  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

845
846 #[test]
847 fn test_hunks_modify_pair_offsets() {
848 // A Modify emits adjacent removed+added at line 5.
849 let changed = vec![
850 NumberedLine::removed("old", 5, 0),
851 NumberedLine::added("new", 5, -1),
852 ];
853 let hunks = Diff::hunks_from_changed_lines(&changed, None, 3);
854 assert_eq!(hunks.len(), 1);
855 assert_eq!(hunks[0].header(), "@@ -5,1 +5,1 @@");
856 assert!(hunks[0].lines[0].is_removed());
857 assert!(hunks[0].lines[1].is_added());
858 }
859
860 #[test]
861 fn test_hunks_empty_input() {

Callers

nothing calls this directly

Calls 1

hunks_from_changed_linesFunction · 0.85

Tested by

no test coverage detected