aboutsummaryrefslogtreecommitdiff
path: root/test/js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-09-19 18:16:51 -0700
committerGravatar GitHub <noreply@github.com> 2023-09-19 18:16:51 -0700
commit5defdf3e28249b34772864a50273a390d345b2df (patch)
tree499f8138fae7309a4ba1ce00041604a96ab04deb /test/js
parentf8d7f50cdbee67e938205afbb71b3e13cfddeba3 (diff)
downloadbun-5defdf3e28249b34772864a50273a390d345b2df.tar.gz
bun-5defdf3e28249b34772864a50273a390d345b2df.tar.zst
bun-5defdf3e28249b34772864a50273a390d345b2df.zip
Fixes #5769 (#5775)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'test/js')
-rw-r--r--test/js/node/path/path.test.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/js/node/path/path.test.js b/test/js/node/path/path.test.js
index 26b6a3b6d..1d14e1d9e 100644
--- a/test/js/node/path/path.test.js
+++ b/test/js/node/path/path.test.js
@@ -271,6 +271,19 @@ it("path.basename", () => {
strictEqual(path.posix.basename(`/a/b/${controlCharFilename}`), controlCharFilename);
});
+describe("path.join #5769", () => {
+ for (let length of [4096, 4095, 4097, 65_432, 65_431, 65_433]) {
+ it("length " + length, () => {
+ const tooLengthyFolderName = Array.from({ length }).fill("b").join("");
+ expect(path.join(tooLengthyFolderName)).toEqual("b".repeat(length));
+ });
+ it("length " + length + "joined", () => {
+ const tooLengthyFolderName = Array.from({ length }).fill("b");
+ expect(path.join(...tooLengthyFolderName)).toEqual("b/".repeat(length).substring(0, 2 * length - 1));
+ });
+ }
+});
+
it("path.join", () => {
const failures = [];
const backslashRE = /\\/g;