mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Zack Radisic <zackradisic@users.noreply.github.com> Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: robobun <robobun@oven.sh>
23 lines
673 B
TypeScript
23 lines
673 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
import { isPosix } from "harness";
|
|
import { createTestBuilder } from "./test_builder";
|
|
const TestBuilder = createTestBuilder(import.meta.path);
|
|
|
|
describe.if(isPosix)("IOWriter epipe", () => {
|
|
TestBuilder.command`yes | head`
|
|
.exitCode(0)
|
|
.stdout("y\ny\ny\ny\ny\ny\ny\ny\ny\ny\n")
|
|
.runAsTest("builtin pipe to command");
|
|
|
|
test("concurrent", async () => {
|
|
const promises = Array(100)
|
|
.fill(0)
|
|
.map(() => Bun.$`yes | head`.text());
|
|
|
|
const results = await Promise.all(promises);
|
|
for (const result of results) {
|
|
expect(result).toBe("y\ny\ny\ny\ny\ny\ny\ny\ny\ny\n");
|
|
}
|
|
});
|
|
});
|