-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: empty strings were ignored #195
Conversation
@@ -1245,8 +1245,11 @@ Deno.test("copy test", async () => { | |||
"cp: target 'non-existent' is not a directory\n", | |||
); | |||
|
|||
assertEquals(await getStdErr($`cp "" ""`), "cp: missing file operand\n"); | |||
assertStringIncludes(await getStdErr($`cp ${file1} ""`), "cp: missing destination file operand after"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cp file1 ""
should try to create a file ""
and fail, but it is considered a copy to cwd
.
This is another issue.
$ cp file1 ""
cp: cannot create regular file '': No such file or directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the PRs!
Deno.test("should support empty quoted string", async () => { | ||
const output = await $`echo '' test ''`.text(); | ||
assertEquals(output, " test "); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a basic test. In the future, I recommend doing this because it helps prevent against regressions.
deno eval ''
should succeed and output nothing.test