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

Function empty

cranelift/bforest/src/set.rs:385–405  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

383
384 #[test]
385 fn empty() {
386 let mut f = SetForest::<u32>::new();
387 f.clear();
388
389 let mut s = Set::<u32>::new();
390 assert!(s.is_empty());
391 s.clear(&mut f);
392 assert!(!s.contains(7, &f, &()));
393
394 // Iterator for an empty set.
395 assert_eq!(s.iter(&f).next(), None);
396
397 s.retain(&mut f, |_| unreachable!());
398
399 let mut c = SetCursor::new(&mut s, &mut f, &());
400 c.verify();
401 assert_eq!(c.elem(), None);
402
403 assert_eq!(c.goto_first(), None);
404 assert_eq!(c.tpath(), "<empty path>");
405 }
406
407 #[test]
408 fn simple_cursor() {

Callers

nothing calls this directly

Calls 4

newFunction · 0.50
clearMethod · 0.45
retainMethod · 0.45
verifyMethod · 0.45

Tested by

no test coverage detected