()
| 402 | |
| 403 | #[test] |
| 404 | fn test_lcs_computation() { |
| 405 | let old = lines(&["a\n", "b\n", "c\n", "d\n"]); |
| 406 | let new = lines(&["a\n", "c\n", "d\n"]); |
| 407 | |
| 408 | let lcs = compute_lcs(&old, &new); |
| 409 | |
| 410 | // LCS should be a, c, d (3 elements) |
| 411 | assert_eq!(lcs.len(), 3); |
| 412 | assert_eq!(lcs[0].old_idx, 0); |
| 413 | assert_eq!(lcs[0].new_idx, 0); |
| 414 | assert_eq!(lcs[1].old_idx, 2); |
| 415 | assert_eq!(lcs[1].new_idx, 1); |
| 416 | assert_eq!(lcs[2].old_idx, 3); |
| 417 | assert_eq!(lcs[2].new_idx, 2); |
| 418 | } |
| 419 | } |
nothing calls this directly
no test coverage detected