()
| 770 | |
| 771 | #[test] |
| 772 | fn test_adjust_offsets() { |
| 773 | let mut result = DiffResult::new(); |
| 774 | result.push(DiffOp::equal(0, 0, 1)); |
| 775 | result.push(DiffOp::insert(1, 1, 1)); |
| 776 | |
| 777 | result.adjust_offsets(10); |
| 778 | |
| 779 | match &result[0] { |
| 780 | DiffOp::Equal { |
| 781 | old_pos, new_pos, .. |
| 782 | } => { |
| 783 | assert_eq!(*old_pos, 10); |
| 784 | assert_eq!(*new_pos, 10); |
| 785 | } |
| 786 | _ => panic!("Expected Equal"), |
| 787 | } |
| 788 | |
| 789 | match &result[1] { |
| 790 | DiffOp::Insert { |
| 791 | old_pos, new_pos, .. |
| 792 | } => { |
| 793 | assert_eq!(*old_pos, 11); |
| 794 | assert_eq!(*new_pos, 11); |
| 795 | } |
| 796 | _ => panic!("Expected Insert"), |
| 797 | } |
| 798 | } |
| 799 | } |
nothing calls this directly
no test coverage detected