aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/stdio-test-instance-a-lot.js
blob: 71815ddeab2cdbef553422c91e148ecbf8a22ed4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { ArrayBufferSink } from "bun";

const sink = new ArrayBufferSink();

sink.write("hello");
sink.write(" ");
sink.write("world");
sink.write(new TextEncoder().encode("hello again|"));
sink.write(new TextEncoder().encode("😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌"));

const string = Buffer.from(sink.end()).toString().repeat(9999);

if (process.env.TEST_STDIO_STRING) {
  const result = string;
  process.stdout.write(result);
} else {
  const result = Buffer.from(string);
  process.stdout.write(result);
}