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

Method strat

crates/wiggle/tests/strings.rs:68–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66
67impl HelloStringExercise {
68 pub fn strat() -> BoxedStrategy<Self> {
69 (unicode_string_strategy(),)
70 .prop_flat_map(|(test_word,)| {
71 (
72 Just(test_word.clone()),
73 HostMemory::mem_area_strat(test_word.len() as u32),
74 HostMemory::mem_area_strat(4),
75 )
76 })
77 .prop_map(|(test_word, string_ptr_loc, return_ptr_loc)| Self {
78 test_word,
79 string_ptr_loc,
80 return_ptr_loc,
81 })
82 .prop_filter("non-overlapping pointers", |e| {
83 MemArea::non_overlapping_set(&[e.string_ptr_loc, e.return_ptr_loc])
84 })
85 .boxed()
86 }
87
88 pub fn test(&self) {
89 let mut ctx = WasiCtx::new();

Callers

nothing calls this directly

Calls 6

unicode_string_strategyFunction · 0.85
fromFunction · 0.85
ascii_string_strategyFunction · 0.85
boxedMethod · 0.80
cloneMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected