diff options
author | 2023-10-17 14:10:25 -0700 | |
---|---|---|
committer | 2023-10-17 14:10:25 -0700 | |
commit | 7458b969c5d9971e89d187b687e1924e78da427e (patch) | |
tree | ee3dbf95c728cf407bf49a27826b541e9264a8bd /test/regression/issue/04893.test.ts | |
parent | d4a2c29131ec154f5e4db897d4deedab2002cbc4 (diff) | |
parent | e91436e5248d947b50f90b4a7402690be8a41f39 (diff) | |
download | bun-7458b969c5d9971e89d187b687e1924e78da427e.tar.gz bun-7458b969c5d9971e89d187b687e1924e78da427e.tar.zst bun-7458b969c5d9971e89d187b687e1924e78da427e.zip |
Merge branch 'main' into postinstall_3
Diffstat (limited to 'test/regression/issue/04893.test.ts')
-rw-r--r-- | test/regression/issue/04893.test.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/regression/issue/04893.test.ts b/test/regression/issue/04893.test.ts new file mode 100644 index 000000000..43850693b --- /dev/null +++ b/test/regression/issue/04893.test.ts @@ -0,0 +1,23 @@ +import { bunEnv, bunExe } from "harness"; +import { mkdirSync, rmSync, writeFileSync, readFileSync, mkdtempSync } from "fs"; +import { tmpdir } from "os"; +import { join } from "path"; + +it("correctly handles CRLF multiline string in CRLF terminated files", async () => { + const testDir = mkdtempSync(join(tmpdir(), "issue4893-")); + + // 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); +}); |