Skip to content

Commit

Permalink
fix: test do not accept multple line string
Browse files Browse the repository at this point in the history
  • Loading branch information
CSUwangj committed Dec 27, 2022
1 parent d713ad5 commit 3abd38d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@
"lodash": "^4.17.21",
"markdown-it": "^8.4.2",
"require-from-string": "^2.0.2",
"shell-quote": "^1.7.3",
"unescape-js": "^1.1.4",
"vsc-leetcode-cli": "2.8.1"
}
Expand Down
3 changes: 2 additions & 1 deletion src/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { DialogType, promptForOpenOutputChannel, showFileSelectDialog } from "..
import { getActiveFilePath } from "../utils/workspaceUtils";
import * as wsl from "../utils/wslUtils";
import { leetCodeSubmissionProvider } from "../webview/leetCodeSubmissionProvider";
import { quote } from "shell-quote";

export async function testSolution(uri?: vscode.Uri): Promise<void> {
try {
Expand Down Expand Up @@ -89,7 +90,7 @@ export async function testSolution(uri?: vscode.Uri): Promise<void> {

function parseTestString(test: string): string {
if (wsl.useWsl() || !isWindows()) {
return `'${test}'`;
return quote([`'${test}'`]);
}

// In windows and not using WSL
Expand Down

0 comments on commit 3abd38d

Please sign in to comment.