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

Function test_large_common_suffix

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

Source from the content-addressed store, hash-verified

385
386 #[test]
387 fn test_large_common_suffix() {
388 let mut old_strs = vec!["old\n"];
389 old_strs.extend((0..100).map(|_| "same\n"));
390
391 let mut new_strs = vec!["new\n"];
392 new_strs.extend((0..100).map(|_| "same\n"));
393
394 let old = lines(&old_strs);
395 let new = lines(&new_strs);
396
397 let result = diff(&old, &new);
398
399 // Only the first line differs
400 assert_eq!(result.edit_distance(), 2);
401 }
402
403 #[test]
404 fn test_lcs_computation() {

Callers

nothing calls this directly

Calls 3

extendMethod · 0.80
linesFunction · 0.70
diffFunction · 0.70

Tested by

no test coverage detected