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

Function test_unified_diff_identical

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

Source from the content-addressed store, hash-verified

823
824 #[test]
825 fn test_unified_diff_identical() {
826 let content = b"line1\nline2\nline3\n";
827 let diff = UnifiedDiff::new(content, content, Algorithm::Myers);
828
829 assert!(!diff.has_changes());
830 assert_eq!(diff.additions(), 0);
831 assert_eq!(diff.deletions(), 0);
832
833 let lines: Vec<_> = diff.lines().collect();
834 assert_eq!(lines.len(), 3);
835 for line in lines {
836 assert_eq!(line.status, LineStatus::Unchanged);
837 }
838 }
839
840 #[test]
841 fn test_unified_diff_addition() {

Callers

nothing calls this directly

Calls 1

linesMethod · 0.45

Tested by

no test coverage detected