MCPcopy Index your code
hub / github.com/jetify-com/devbox / ExampleCommands_AppendScript

Function ExampleCommands_AppendScript

internal/devbox/shellcmd/command_test.go:154–174  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152}
153
154func ExampleCommands_AppendScript() {
155 shCmds := Commands{}
156 shCmds.AppendScript(`
157 # This script will be unindented by the number of leading tabs
158 # on the first line.
159 if true; then
160 echo "this is always printed"
161 fi`,
162 )
163 b, _ := cuecfg.MarshalJSON(&shCmds)
164 fmt.Println(string(b))
165
166 // Output:
167 // [
168 // "# This script will be unindented by the number of leading tabs",
169 // "# on the first line.",
170 // "if true; then",
171 // "\techo \"this is always printed\"",
172 // "fi"
173 // ]
174}
175
176func TestAppendScript(t *testing.T) {
177 tests := []struct {

Callers

nothing calls this directly

Calls 2

AppendScriptMethod · 0.95
MarshalJSONFunction · 0.92

Tested by

no test coverage detected