()
| 869 | |
| 870 | #[test] |
| 871 | fn deep_clone() { |
| 872 | let pool = &mut ListPool::<Inst>::new(); |
| 873 | |
| 874 | let i1 = Inst::new(1); |
| 875 | let i2 = Inst::new(2); |
| 876 | let i3 = Inst::new(3); |
| 877 | let i4 = Inst::new(4); |
| 878 | |
| 879 | let mut list1 = EntityList::from_slice(&[i1, i2, i3], pool); |
| 880 | let list2 = list1.deep_clone(pool); |
| 881 | assert_eq!(list1.as_slice(pool), &[i1, i2, i3]); |
| 882 | assert_eq!(list2.as_slice(pool), &[i1, i2, i3]); |
| 883 | |
| 884 | list1.as_mut_slice(pool)[0] = i4; |
| 885 | assert_eq!(list1.as_slice(pool), &[i4, i2, i3]); |
| 886 | assert_eq!(list2.as_slice(pool), &[i1, i2, i3]); |
| 887 | } |
| 888 | |
| 889 | #[test] |
| 890 | fn truncate() { |
nothing calls this directly
no test coverage detected