#[test]
fn _0001() {
let wat_str = r#"
(module
(memory (export "mem") 1)
(func (export "fun")
i32.const 22 ;; Start offset in memory; push: 22; stack: 22
i32.const 64 ;; Fill with letter '@'; push: 64; stack: 64 22
i32.const 11 ;; Length in bytes to be filled; push: 11; stack: 11 64 22
memory.fill ;; Fill the memory; stack: (empty}
)
)
"#;
let wasm_bytes = wat::parse_str(wat_str).unwrap();
let engine = wasmtime::Engine::default();
let module = wasmtime::Module::from_binary(&engine, &wasm_bytes).unwrap();
let mut store = wasmtime::Store::new(&engine, ());
let instance = wasmtime::Instance::new(&mut store, &module, &[]).unwrap();
let memory = instance.get_memory(&mut store, "mem").unwrap();
let fun = instance.get_typed_func::<(), ()>(&mut store, "fun").unwrap();
fun.call(&mut store, ()).unwrap();
let data = &memory.data(&mut store)[20..35];
assert_eq!(b"\0\0@@@@@@@@@@@\0\0", data);
}