MCPcopy
hub / github.com/docker/compose / TestHandleHook_ComposeAnsiNeverDisablesOsc8

Function TestHandleHook_ComposeAnsiNeverDisablesOsc8

cmd/compose/hooks_test.go:238–250  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

236}
237
238func TestHandleHook_ComposeAnsiNeverDisablesOsc8(t *testing.T) {
239 t.Setenv("COMPOSE_ANSI", "never")
240 data := marshalHookData(t, hooks.Request{
241 RootCmd: "compose logs",
242 })
243 var buf bytes.Buffer
244 err := handleHook(t.Context(), []string{data}, &buf)
245 assert.NilError(t, err)
246
247 msg := unmarshalResponse(t, buf.Bytes())
248 assert.Assert(t, strings.Contains(msg.Template, testDeepLink), "hint should contain the deep link URL")
249 assert.Assert(t, !strings.Contains(msg.Template, "\033"), "hint should not contain ANSI escape sequences")
250}
251
252func TestResolveAppID_ShortCircuitsOnFlag(t *testing.T) {
253 tests := []struct {

Callers

nothing calls this directly

Calls 4

marshalHookDataFunction · 0.85
handleHookFunction · 0.85
unmarshalResponseFunction · 0.85
BytesMethod · 0.80

Tested by

no test coverage detected