()
| 706 | #[test] |
| 707 | #[expect(clippy::integer_division_remainder_used)] |
| 708 | fn map_repeat() { |
| 709 | let heap = Heap::new(); |
| 710 | let interner = InternSet::new(&heap); |
| 711 | let original = interner.intern_slice(&[1, 2, 3, 4, 5]); |
| 712 | |
| 713 | let mut beef = Beef::new(original); |
| 714 | |
| 715 | // First modification |
| 716 | beef.map(|x| if x % 2 == 0 { x * 2 } else { x }); |
| 717 | assert_eq!(beef.as_slice(), &[1, 4, 3, 8, 5]); |
| 718 | |
| 719 | // Second modification |
| 720 | beef.map(|x| x + 1); |
| 721 | assert_eq!(beef.as_slice(), &[2, 5, 4, 9, 6]); |
| 722 | |
| 723 | // Result should be interned with all modifications applied |
| 724 | let result = beef.finish(&interner); |
| 725 | assert_eq!(result.as_ref(), &[2, 5, 4, 9, 6]); |
| 726 | } |
| 727 | |
| 728 | #[test] |
| 729 | fn map_edge_cases() { |
nothing calls this directly
no test coverage detected