mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 05:42:43 +00:00
* Move ReadFile and WriteFile to separate file * Use libuv for Bun.write() * Update windows_event_loop.zig * build * Get bun-write tests to pass. Implement Bun.write with two files. * UPdate * Update * Update failing test list * update * More * More * More * More * Mark the rest * ok * oops * Update bun-write.test.js * Update blob.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Dave Caruso <me@paperdave.net> Co-authored-by: Georgijs Vilums <georgijs.vilums@gmail.com>
24 lines
767 B
TypeScript
24 lines
767 B
TypeScript
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);
|
|
});
|