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

Function TestTrim

pkg/plugins/item_params_test.go:176–192  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

174}
175
176func TestTrim(t *testing.T) {
177 is := is.New(t)
178
179 ctx := context.Background()
180 p := &Plugin{}
181 items, err := p.parseOutput(ctx, "test.txt", strings.NewReader(strings.TrimSpace(`
182
183 cycle1 | trim=true
184 cycle2 | trim=false
185 cycle3
186 `)))
187 is.NoErr(err)
188 is.Equal(len(items.CycleItems), 3) // CycleItems
189 is.Equal(items.CycleItems[0].Text, `cycle1`)
190 is.Equal(items.CycleItems[1].Text, ` cycle2 `)
191 is.Equal(items.CycleItems[2].Text, `cycle3`)
192}
193
194func TestSeparator(t *testing.T) {
195 is := is.New(t)

Callers

nothing calls this directly

Calls 1

parseOutputMethod · 0.95

Tested by

no test coverage detected