mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Zack Radisic <zackradisic@users.noreply.github.com>
26 lines
832 B
TypeScript
26 lines
832 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
import { bunExe, isPosix } from "harness";
|
|
import path from "path";
|
|
|
|
describe.if(isPosix)("garbage env", () => {
|
|
test("garbage env", async () => {
|
|
const cfile = path.join(import.meta.dirname, "garbage-env.c");
|
|
{
|
|
const cc = Bun.which("clang") || Bun.which("gcc") || Bun.which("cc");
|
|
const { exitCode, stderr } = await Bun.$`${cc} -o garbage-env ${cfile}`;
|
|
const stderrText = stderr.toString();
|
|
if (stderrText.length > 0) {
|
|
console.error(stderrText);
|
|
}
|
|
expect(exitCode).toBe(0);
|
|
}
|
|
|
|
const { exitCode, stderr } = await Bun.$`./garbage-env`.env({ BUN_PATH: bunExe() });
|
|
const stderrText = stderr.toString();
|
|
if (stderrText.length > 0) {
|
|
console.error(stderrText);
|
|
}
|
|
expect(exitCode).toBe(0);
|
|
});
|
|
});
|