diff options
author | 2023-09-11 21:19:43 -0300 | |
---|---|---|
committer | 2023-09-11 17:19:43 -0700 | |
commit | c9a0ea96cd13df39fdfc4c1ebb897453517718f3 (patch) | |
tree | 1f2e85e1e0024f7a2134e0452b01d92e08033544 /test/js | |
parent | ca461f9e83b2c692442bb7e20c2f9e3670d2ef6a (diff) | |
download | bun-c9a0ea96cd13df39fdfc4c1ebb897453517718f3.tar.gz bun-c9a0ea96cd13df39fdfc4c1ebb897453517718f3.tar.zst bun-c9a0ea96cd13df39fdfc4c1ebb897453517718f3.zip |
fix(BunFile) .slice offset on macOS (#4991)
* fix offset
* simplify error
Diffstat (limited to 'test/js')
-rw-r--r-- | test/js/bun/io/bun-write.test.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/js/bun/io/bun-write.test.js b/test/js/bun/io/bun-write.test.js index b67df9405..f435d2ceb 100644 --- a/test/js/bun/io/bun-write.test.js +++ b/test/js/bun/io/bun-write.test.js @@ -291,6 +291,15 @@ it.skip("Bun.write('output.html', HTMLRewriter.transform(Bun.file)))", async don done(); }); +it("offset should work #4963", async () => { + const filename = tmpdir() + "/bun.test.offset.txt"; + await Bun.write(filename, "contents"); + const file = Bun.file(filename); + const slice = file.slice(2, file.size); + const contents = await slice.text(); + expect(contents).toBe("ntents"); +}); + it("#2674", async () => { const file = path.join(import.meta.dir, "big-stdout.js"); |