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

Function stress

crates/environ/src/string_pool.rs:341–356  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

339
340 #[test]
341 fn stress() -> Result<()> {
342 let mut pool = StringPool::new();
343
344 let n = if cfg!(miri) { 100 } else { 10_000 };
345
346 for _ in 0..2 {
347 let atoms: TryVec<_> = (0..n).map(|i| pool.insert(&i.to_string())).try_collect()?;
348
349 for atom in atoms {
350 assert!(pool.contains(atom));
351 assert_eq!(&pool[atom], atom.index().to_string());
352 }
353 }
354
355 Ok(())
356 }
357
358 #[test]
359 fn roundtrip_serialize_deserialize() -> Result<()> {

Callers

nothing calls this directly

Calls 6

OkFunction · 0.85
try_collectMethod · 0.80
newFunction · 0.50
mapMethod · 0.45
insertMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected