TestPipeElsewhere checks to see if the plugin can handle a pipe elsewhere in the output. https://github.com/matryer/xbar/issues/743
(t *testing.T)
| 319 | // a pipe elsewhere in the output. |
| 320 | // https://github.com/matryer/xbar/issues/743 |
| 321 | func TestPipeElsewhere(t *testing.T) { |
| 322 | is := is.New(t) |
| 323 | |
| 324 | p := &Plugin{} |
| 325 | in := `Copy TITLE | font=Monaco size=10 alternate=true shell='/bin/bash' param1='-c' param2="echo -n string | pbcopy" terminal=false` |
| 326 | items, err := p.parseOutput(context.Background(), "text.txt", strings.NewReader(in)) |
| 327 | is.NoErr(err) |
| 328 | |
| 329 | is.Equal(len(items.CycleItems), 1) |
| 330 | is.Equal(len(items.CycleItems[0].Params.ShellParams), 2) |
| 331 | is.Equal(items.CycleItems[0].Params.ShellParams[0], "-c") |
| 332 | is.Equal(items.CycleItems[0].Params.ShellParams[1], "echo -n string | pbcopy") |
| 333 | } |
nothing calls this directly
no test coverage detected