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