()
| 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() { |