()
| 909 | |
| 910 | #[test] |
| 911 | fn copy_from() { |
| 912 | let pool = &mut ListPool::<Inst>::new(); |
| 913 | |
| 914 | let i1 = Inst::new(1); |
| 915 | let i2 = Inst::new(2); |
| 916 | let i3 = Inst::new(3); |
| 917 | let i4 = Inst::new(4); |
| 918 | |
| 919 | let mut list = EntityList::from_slice(&[i1, i2, i3, i4], pool); |
| 920 | assert_eq!(list.as_slice(pool), &[i1, i2, i3, i4]); |
| 921 | let list2 = EntityList::from_slice(&[i4, i3, i2, i1], pool); |
| 922 | assert_eq!(list2.as_slice(pool), &[i4, i3, i2, i1]); |
| 923 | list.copy_from(&list2, 0..0, 0, pool); |
| 924 | assert_eq!(list.as_slice(pool), &[i1, i2, i3, i4]); |
| 925 | list.copy_from(&list2, 0..4, 0, pool); |
| 926 | assert_eq!(list.as_slice(pool), &[i4, i3, i2, i1, i1, i2, i3, i4]); |
| 927 | } |
| 928 | |
| 929 | #[test] |
| 930 | #[should_panic] |
no test coverage detected