-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ssh-args): parse escaped quotes correctly
- Loading branch information
Showing
3 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package options | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestOptions(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Options Suite") | ||
} | ||
|
||
var _ = Describe("Test parsing SSHArgs", func() { | ||
DescribeTable("SSH arguments parsing", | ||
func(input string, expected []string) { | ||
Expect(parseSSHArgs(input)).To(Equal(expected)) | ||
}, | ||
Entry("whitespace separated arguments", | ||
"arg1 arg2 arg3", | ||
[]string{"arg1", "arg2", "arg3"}, | ||
), | ||
Entry("not split by whitespace inside quotes", | ||
"arg1 arg2 ProxyCommand=\"cmd\"", | ||
[]string{"arg1", "arg2", "ProxyCommand=\"cmd\""}, | ||
), | ||
Entry("not split by comma", | ||
"arg1,arg2 ProxyCommand=\"cmd\"", | ||
[]string{"arg1,arg2", "ProxyCommand=\"cmd\""}, | ||
), | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters