diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2024-03-06 12:39:07 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2024-03-11 09:36:35 -0700 |
| commit | 7141379559e2ef17e48dfbadc898581cd34bef6f (patch) | |
| tree | 626bcaef1d4ed48bb18c8ebb63851ba2e4db6be9 /tests/run-make/wasm-import-module/foo.js | |
| parent | d255c6a57c393db6221b1ff700daea478436f1cd (diff) | |
| download | rust-7141379559e2ef17e48dfbadc898581cd34bef6f.tar.gz rust-7141379559e2ef17e48dfbadc898581cd34bef6f.zip | |
Convert some WebAssembly run-make tests to Rust
This commit rewrites a number of `run-make` tests centered around wasm to instead use `rmake.rs` and additionally use the `wasm32-wasip1` target instead of `wasm32-unknown-unknown`. Testing no longer requires Node.js and additionally uses the `wasmparser` crate from crates.io to parse outputs and power assertions.
Diffstat (limited to 'tests/run-make/wasm-import-module/foo.js')
| -rw-r--r-- | tests/run-make/wasm-import-module/foo.js | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/tests/run-make/wasm-import-module/foo.js b/tests/run-make/wasm-import-module/foo.js deleted file mode 100644 index 3ea47fcc930..00000000000 --- a/tests/run-make/wasm-import-module/foo.js +++ /dev/null @@ -1,18 +0,0 @@ -const fs = require('fs'); -const process = require('process'); -const assert = require('assert'); -const buffer = fs.readFileSync(process.argv[2]); - -let m = new WebAssembly.Module(buffer); -let imports = WebAssembly.Module.imports(m); -console.log('imports', imports); -assert.strictEqual(imports.length, 2); - -assert.strictEqual(imports[0].kind, 'function'); -assert.strictEqual(imports[1].kind, 'function'); - -let modules = [imports[0].module, imports[1].module]; -modules.sort(); - -assert.strictEqual(modules[0], './dep'); -assert.strictEqual(modules[1], './me'); |
