Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (13 sloc) 355 Bytes
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);
});
You can’t perform that action at this time.