MCPcopy
hub / github.com/matryer/xbar / TestPipeElsewhere

Function TestPipeElsewhere

pkg/plugins/plugin_test.go:321–333  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

319// a pipe elsewhere in the output.
320// https://github.com/matryer/xbar/issues/743
321func 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}

Callers

nothing calls this directly

Calls 1

parseOutputMethod · 0.95

Tested by

no test coverage detected