This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up
Fetching contributors…
| const { test } = require("ava"); | |
| const loadRust = require("../src/compile"); | |
| const wrap = require("../src/wrap"); | |
| test("it works!", async (t) => { | |
| const instance = await loadRust(` | |
| #[no_mangle] | |
| pub extern "C" fn foo() -> i32 { | |
| return 32; | |
| } | |
| `); | |
| const foo = wrap(instance.exports, "foo", [], "i32"); | |
| t.deepEqual(foo(), 32); | |
| }); |