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

Function test_edit_distance

atomic-core/src/diff/myers.rs:359–367  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

357
358 #[test]
359 fn test_edit_distance() {
360 let old = lines(&["a\n", "b\n", "c\n"]);
361 let new = lines(&["a\n", "x\n", "y\n", "c\n"]);
362
363 let result = diff(&old, &new);
364
365 // Delete b, insert x, insert y = 3 operations
366 assert_eq!(result.edit_distance(), 3);
367 }
368
369 #[test]
370 fn test_large_common_prefix() {

Callers

nothing calls this directly

Calls 2

linesFunction · 0.70
diffFunction · 0.70

Tested by

no test coverage detected