mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
format
This commit is contained in:
@@ -7,24 +7,24 @@ import { tmpdir } from "os";
|
||||
import { join } from "path";
|
||||
|
||||
it("macros should not lead to seg faults under any given input", async () => {
|
||||
// this test code follows the same structure as and
|
||||
// is based on the code for testing issue 4893
|
||||
// this test code follows the same structure as and
|
||||
// is based on the code for testing issue 4893
|
||||
|
||||
const testDir = mkdtempSync(join(tmpdir(), "issue3830-"));
|
||||
const testDir = mkdtempSync(join(tmpdir(), "issue3830-"));
|
||||
|
||||
// Clean up from prior runs if necessary
|
||||
rmSync(testDir, { recursive: true, force: true });
|
||||
// Clean up from prior runs if necessary
|
||||
rmSync(testDir, { recursive: true, force: true });
|
||||
|
||||
// Create a directory with our test file
|
||||
mkdirSync(testDir, { recursive: true });
|
||||
writeFileSync(join(testDir, "macro.ts"), 'export function fn(str) { return str; }');
|
||||
writeFileSync(join(testDir, "index.ts"), "import { fn } from './macro' assert { type: 'macro' };\nfn(`©${''}`);");
|
||||
// Create a directory with our test file
|
||||
mkdirSync(testDir, { recursive: true });
|
||||
writeFileSync(join(testDir, "macro.ts"), "export function fn(str) { return str; }");
|
||||
writeFileSync(join(testDir, "index.ts"), "import { fn } from './macro' assert { type: 'macro' };\nfn(`©${''}`);");
|
||||
|
||||
const { stdout, exitCode } = Bun.spawnSync({
|
||||
cmd: [bunExe(), "build", join(testDir, "index.ts")],
|
||||
env: bunEnv,
|
||||
stderr: "inherit",
|
||||
});
|
||||
const { stdout, exitCode } = Bun.spawnSync({
|
||||
cmd: [bunExe(), "build", join(testDir, "index.ts")],
|
||||
env: bunEnv,
|
||||
stderr: "inherit",
|
||||
});
|
||||
|
||||
expect(exitCode).toBe(0);
|
||||
});
|
||||
expect(exitCode).toBe(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user