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

Function test_large_common_prefix

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

Source from the content-addressed store, hash-verified

368
369 #[test]
370 fn test_large_common_prefix() {
371 let mut old_strs: Vec<&str> = (0..100).map(|_| "same\n").collect();
372 old_strs.push("old\n");
373
374 let mut new_strs: Vec<&str> = (0..100).map(|_| "same\n").collect();
375 new_strs.push("new\n");
376
377 let old = lines(&old_strs);
378 let new = lines(&new_strs);
379
380 let result = diff(&old, &new);
381
382 // Only the last line differs
383 assert_eq!(result.edit_distance(), 2); // delete old, insert new
384 }
385
386 #[test]
387 fn test_large_common_suffix() {

Callers

nothing calls this directly

Calls 4

linesFunction · 0.70
diffFunction · 0.70
collectMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected