File: exec.tjs

package info (click to toggle)
node-webassemblyjs 1.11.0%2Bdfsg%2B~cs10.10.16-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,040 kB
  • sloc: javascript: 28,630; makefile: 84; sh: 42; ansic: 16
file content (12 lines) | stat: -rw-r--r-- 345 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
it("should instantiate the data section", () => {
  return WebAssembly.instantiate(wasmmodule).then(m => {
    const { memory } = m.instance.exports;

    const i32 = new Uint8Array(memory.buffer);

    // store a number
    assert.equal(i32[2], 97 /* a */);
    assert.equal(i32[3], 98 /* b */);
    assert.equal(i32[4], 99 /* c */);
  });
});