()
| 152 | } |
| 153 | |
| 154 | func 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 | |
| 176 | func TestAppendScript(t *testing.T) { |
| 177 | tests := []struct { |
nothing calls this directly
no test coverage detected