diff options
Diffstat (limited to 'test/js/node/path/path.test.js')
-rw-r--r-- | test/js/node/path/path.test.js | 13 |
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; |