diff options
| author | Soccera1 <[email protected]> | 2026-07-18 07:51:42 +1000 |
|---|---|---|
| committer | Soccera1 <[email protected]> | 2026-07-18 07:51:42 +1000 |
| commit | a753f669c9bedfccb9f7f400da018bb487dca5d0 (patch) | |
| tree | 6a5600e6719a6dd69ef035f8f22fea37bd4ea8c1 /tests/coreutils.test.js | |
| parent | 8b8e40523f999fa2e2d676f591ac85c60f063083 (diff) | |
| download | bnu-a753f669c9bedfccb9f7f400da018bb487dca5d0.tar.gz bnu-a753f669c9bedfccb9f7f400da018bb487dca5d0.zip | |
Fix shell quoting
Diffstat (limited to 'tests/coreutils.test.js')
| -rw-r--r-- | tests/coreutils.test.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/coreutils.test.js b/tests/coreutils.test.js index 1d779d2..34e9dfa 100644 --- a/tests/coreutils.test.js +++ b/tests/coreutils.test.js @@ -5823,6 +5823,11 @@ test("ls supports common listing modes", async () => { await writeFile(join(dir, "quote/line\nbreak"), "x"); await writeFile(join(dir, "quote/q\x07"), "x"); await writeFile(join(dir, "quote/plain"), "x"); + await mkdir(join(dir, "tty-quote")); + await writeFile(join(dir, "tty-quote/line\n\nbreak"), "x"); + const ttyQuoted = await shell(`script -qefc '"$BUN" "$BNU" ls -1 tty-quote' /dev/null`); + expect(ttyQuoted).toMatchObject({ code: 0, stderr: "" }); + expect(ttyQuoted.stdout.replaceAll("\r\n", "\n")).toBe("'line'$'\\n\\n''break'\n"); expect((await run(["ls", "-1", "--quoting-style=shell", "quote/name with spaces", "quote/plain"])).stdout).toBe("'quote/name with spaces'\nquote/plain\n"); expect((await run(["ls", "-1", "--quoting-style=shell", "quote/name'with-quote"])).stdout).toBe("\"quote/name'with-quote\"\n"); expect((await run(["ls", "-1", "--quoting-style=shell-always", "quote/plain"])).stdout).toBe("'quote/plain'\n"); |
