-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Allow OSCommand.Quote
to be invoked within a custom command
#2193
Allow OSCommand.Quote
to be invoked within a custom command
#2193
Conversation
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.
Great idea! Could we add a test for this? Either a unit test or integration test
b21c2ab
to
e16f1ba
Compare
add simple test case using existing integration test. |
@@ -37,7 +37,7 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{ | |||
{ | |||
Name: "bar", | |||
Description: "Bar", | |||
Value: "BAR", | |||
Value: `"BAR"`, |
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.
Why are we quoting this? Shouldn't we not have quotes in the value so that we can ensure that it's properly quoted by the quote function?
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.
This is testing to be escaped "
itself. Without | Quote
, only BAR
is output even if value
is `"BAR"`
.
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.
Ah I see: we need the quotes in the value so that when call the quote function the quotes are escaped and end up in the diff. Okay that makes sense!
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.
one question :)
There are many situations where we will want to use
Quote
.go run scripts/cheatsheet/main.go generate
)docs/Config.md
) have been updated if necessary