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

Function TestTokenTooLong

pkg/plugins/parse_test.go:137–152  ·  view source on GitHub ↗

TestTokenTooLong tests for really long tokens. https://github.com/matryer/xbar/issues/629

(t *testing.T)

Source from the content-addressed store, hash-verified

135// TestTokenTooLong tests for really long tokens.
136// https://github.com/matryer/xbar/issues/629
137func TestTokenTooLong(t *testing.T) {
138 is := is.New(t)
139
140 f, err := os.Open(filepath.Join("testdata", "token-too-long", "jma.1h.sh.output"))
141 is.NoErr(err) // os.Open
142 t.Cleanup(func() {
143 err := f.Close()
144 is.NoErr(err) // f.Close
145 })
146
147 p := Plugin{}
148 ctx := context.Background()
149 items, err := p.parseOutput(ctx, "jma.1h.sh", f)
150 is.NoErr(err)
151 is.Equal(len(items.CycleItems), 1)
152}
153
154// TestNestedSeparators ensures separators work inside submenus.
155// https://github.com/matryer/xbar/issues/648

Callers

nothing calls this directly

Calls 1

parseOutputMethod · 0.95

Tested by

no test coverage detected