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

Function try_vec_resize

crates/fuzzing/tests/oom/vec.rs:129–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127
128#[test]
129fn try_vec_resize() -> Result<()> {
130 OomTest::new().test(|| {
131 let mut v = TryVec::new();
132 v.resize(10, 'a')?; // Grow.
133 v.resize(1, 'b')?; // Truncate.
134 v.resize(1, 'c')?; // Same length.
135 v.resize(3, 'd')?; // Grow again.
136 assert_eq!(&*v, &['a', 'd', 'd']);
137 Ok(())
138 })
139}
140
141#[test]
142fn try_vec_try_collect() -> Result<()> {

Callers

nothing calls this directly

Calls 4

OkFunction · 0.85
newFunction · 0.50
testMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected