Skip to content

Commit 9bd905e

Browse files
committed
add test for #4893
1 parent 2457ab6 commit 9bd905e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/regression/issue/4893.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { bunEnv, bunExe } from "harness";
2+
import { mkdirSync, rmSync, writeFileSync, readFileSync, mkdtempSync } from "fs";
3+
import { tmpdir } from "os";
4+
import { join } from "path";
5+
6+
it("correctly handles CRLF multiline string in CRLF terminated files", async () => {
7+
const testDir = mkdtempSync(join(tmpdir(), "issue4893-"));
8+
9+
// Clean up from prior runs if necessary
10+
rmSync(testDir, { recursive: true, force: true });
11+
12+
// Create a directory with our test package file
13+
mkdirSync(testDir, { recursive: true });
14+
writeFileSync(join(testDir, "crlf.js"), '"a\\\r\nb"');
15+
16+
const { stdout, exitCode } = Bun.spawnSync({
17+
cmd: [bunExe(), "run", join(testDir, "crlf.js")],
18+
env: bunEnv,
19+
stderr: "inherit",
20+
});
21+
22+
expect(exitCode).toBe(0);
23+
});

0 commit comments

Comments
 (0)