mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 13:22:07 +00:00
@@ -57,7 +57,7 @@ const FFIType = {
|
||||
fn: 17,
|
||||
};
|
||||
|
||||
const suffix = process.platform === "win32" ? ".dll" : process.platform === "darwin" ? ".dylib" : ".so";
|
||||
const suffix = process.platform === "win32" ? "dll" : process.platform === "darwin" ? "dylib" : "so";
|
||||
|
||||
declare const __GlobalBunFFIPtrFunctionForWrapper: typeof ptr;
|
||||
declare const __GlobalBunCString: typeof CString;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -10,6 +10,7 @@ import {
|
||||
toArrayBuffer,
|
||||
toBuffer,
|
||||
viewSource,
|
||||
suffix,
|
||||
} from "bun:ffi";
|
||||
|
||||
const dlopen = (...args) => {
|
||||
@@ -20,7 +21,7 @@ const dlopen = (...args) => {
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
const ok = existsSync("/tmp/bun-ffi-test.dylib");
|
||||
const ok = existsSync("/tmp/bun-ffi-test." + suffix);
|
||||
|
||||
it("ffi print", async () => {
|
||||
await Bun.write(
|
||||
@@ -626,3 +627,7 @@ it("dlopen throws an error instead of returning it", () => {
|
||||
}
|
||||
expect(err).toBeTruthy();
|
||||
});
|
||||
|
||||
it('suffix does not start with a "."', () => {
|
||||
expect(suffix).not.toMatch(/^\./);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user