()
| 779 | |
| 780 | #[test] |
| 781 | fn test_multiple_conflicts() { |
| 782 | with_writer(|writer| { |
| 783 | // First conflict |
| 784 | writer.begin_conflict(1, None).unwrap(); |
| 785 | writer.write_all(b"A1\n").unwrap(); |
| 786 | writer.conflict_next(1, None).unwrap(); |
| 787 | writer.write_all(b"A2\n").unwrap(); |
| 788 | writer.end_conflict(1).unwrap(); |
| 789 | |
| 790 | // Some normal content |
| 791 | writer.write_all(b"normal\n").unwrap(); |
| 792 | |
| 793 | // Second conflict |
| 794 | writer.begin_conflict(2, None).unwrap(); |
| 795 | writer.write_all(b"B1\n").unwrap(); |
| 796 | writer.conflict_next(2, None).unwrap(); |
| 797 | writer.write_all(b"B2\n").unwrap(); |
| 798 | writer.end_conflict(2).unwrap(); |
| 799 | |
| 800 | let conflicts = writer.conflicts(); |
| 801 | assert_eq!(conflicts.len(), 2); |
| 802 | assert_eq!(conflicts[0].id, Some(1)); |
| 803 | assert_eq!(conflicts[1].id, Some(2)); |
| 804 | }); |
| 805 | } |
| 806 | |
| 807 | // ------------------------------------------------------------------------ |
| 808 | // Conflict Next Adds Hash Tests |
nothing calls this directly
no test coverage detected