mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
Co-authored-by: nektro <nektro@users.noreply.github.com> Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
24 lines
733 B
TypeScript
24 lines
733 B
TypeScript
import { bunEnv, bunExe, tmpdirSync } from "harness";
|
|
import { mkdirSync, rmSync, writeFileSync } from "fs";
|
|
import { join } from "path";
|
|
import { it, expect } from "bun:test";
|
|
|
|
it("correctly handles CRLF multiline string in CRLF terminated files", async () => {
|
|
const testDir = tmpdirSync();
|
|
|
|
// Clean up from prior runs if necessary
|
|
rmSync(testDir, { recursive: true, force: true });
|
|
|
|
// Create a directory with our test CRLF terminated file
|
|
mkdirSync(testDir, { recursive: true });
|
|
writeFileSync(join(testDir, "crlf.js"), '"a\\\r\nb"');
|
|
|
|
const { stdout, exitCode } = Bun.spawnSync({
|
|
cmd: [bunExe(), "run", join(testDir, "crlf.js")],
|
|
env: bunEnv,
|
|
stderr: "inherit",
|
|
});
|
|
|
|
expect(exitCode).toBe(0);
|
|
});
|