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

Function test_edit_distance

atomic-core/src/diff/patience.rs:673–681  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

671
672 #[test]
673 fn test_edit_distance() {
674 let old = lines(&["a\n", "b\n", "c\n"]);
675 let new = lines(&["a\n", "x\n", "y\n", "c\n"]);
676
677 let result = diff(&old, &new);
678
679 // Delete b, insert x, insert y = 3 operations
680 assert_eq!(result.edit_distance(), 3);
681 }
682}

Callers

nothing calls this directly

Calls 2

linesFunction · 0.70
diffFunction · 0.70

Tested by

no test coverage detected