From e8ff9c7ffb1aa2de88b5f17c8ebe7447b320a96a Mon Sep 17 00:00:00 2001 From: Patrick Juchli Date: Tue, 19 Dec 2023 20:18:11 +0100 Subject: [PATCH] Test whitespace protection for relative paths --- test/commandSpec.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/commandSpec.js b/test/commandSpec.js index 4b8a1ef..2b0cf8e 100644 --- a/test/commandSpec.js +++ b/test/commandSpec.js @@ -112,7 +112,7 @@ describe("Simple commands", function() { }) }) - it("can handle leading whitespace in paths", () => { + it("can handle leading whitespace in a filename", () => { this.server.addHandlers({ "pwd": () => `257 "/this/that"` }) @@ -121,6 +121,15 @@ describe("Simple commands", function() { }) }) + it("can handle leading whitespace in relative path", () => { + this.server.addHandlers({ + "pwd": () => `257 "/this/that"` + }) + return this.client.protectWhitespace(" a/b").then(result => { + assert.strictEqual(result, "/this/that/ a/b") + }) + }) + it("can remove a file") it("can change directory") it("can get the current working directory")