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

Function empty

cranelift/bforest/src/map.rs:884–907  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

882
883 #[test]
884 fn empty() {
885 let mut f = MapForest::<u32, f32>::new();
886 f.clear();
887
888 let mut m = Map::<u32, f32>::new();
889 assert!(m.is_empty());
890 m.clear(&mut f);
891
892 assert_eq!(m.get(7, &f, &()), None);
893 assert_eq!(m.iter(&f).next(), None);
894 assert_eq!(m.get_or_less(7, &f, &()), None);
895 m.retain(&mut f, |_, _| unreachable!());
896
897 let mut c = m.cursor_mut(&mut f, &());
898 assert!(c.is_empty());
899 assert_eq!(c.key(), None);
900 assert_eq!(c.value(), None);
901 assert_eq!(c.next(), None);
902 assert_eq!(c.prev(), None);
903 c.verify();
904 assert_eq!(c.tpath(), "<empty path>");
905 assert_eq!(c.goto_first(), None);
906 assert_eq!(c.tpath(), "<empty path>");
907 }
908
909 #[test]
910 fn inserting() {

Callers

nothing calls this directly

Calls 5

cursor_mutMethod · 0.80
newFunction · 0.50
clearMethod · 0.45
retainMethod · 0.45
verifyMethod · 0.45

Tested by

no test coverage detected