()
| 716 | |
| 717 | #[test] |
| 718 | fn from_slice() { |
| 719 | let pool = &mut ListPool::<Inst>::new(); |
| 720 | |
| 721 | let list = EntityList::<Inst>::from_slice(&[Inst(0), Inst(1)], pool); |
| 722 | assert!(!list.is_empty()); |
| 723 | assert_eq!(list.len(pool), 2); |
| 724 | assert_eq!(list.as_slice(pool), &[Inst(0), Inst(1)]); |
| 725 | assert_eq!(list.get(0, pool), Some(Inst(0))); |
| 726 | assert_eq!(list.get(100, pool), None); |
| 727 | |
| 728 | let list = EntityList::<Inst>::from_slice(&[], pool); |
| 729 | assert!(list.is_empty()); |
| 730 | assert_eq!(list.len(pool), 0); |
| 731 | assert_eq!(list.as_slice(pool), &[]); |
| 732 | assert_eq!(list.get(0, pool), None); |
| 733 | assert_eq!(list.get(100, pool), None); |
| 734 | } |
| 735 | |
| 736 | #[test] |
| 737 | fn push() { |
no test coverage detected