MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / empty_list

Function empty_list

cranelift/entity/src/list.rs:695–715  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

693
694 #[test]
695 fn empty_list() {
696 let pool = &mut ListPool::<Inst>::new();
697 let mut list = EntityList::<Inst>::default();
698 {
699 let ilist = &list;
700 assert!(ilist.is_empty());
701 assert_eq!(ilist.len(pool), 0);
702 assert_eq!(ilist.as_slice(pool), &[]);
703 assert_eq!(ilist.get(0, pool), None);
704 assert_eq!(ilist.get(100, pool), None);
705 }
706 assert_eq!(list.as_mut_slice(pool), &[]);
707 assert_eq!(list.get_mut(0, pool), None);
708 assert_eq!(list.get_mut(100, pool), None);
709
710 list.clear(pool);
711 assert!(list.is_empty());
712 assert_eq!(list.len(pool), 0);
713 assert_eq!(list.as_slice(pool), &[]);
714 assert_eq!(list.first(pool), None);
715 }
716
717 #[test]
718 fn from_slice() {

Callers

nothing calls this directly

Calls 2

newFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected