MCPcopy Create free account
hub / github.com/cli/cli / TestUntrusted_jsonRoundTrip

Function TestUntrusted_jsonRoundTrip

pkg/iostreams/untrusted_test.go:66–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestUntrusted_jsonRoundTrip(t *testing.T) {
67 u := NewUntrusted("x\x1b[0m")
68 b, err := json.Marshal(u)
69 require.NoError(t, err)
70
71 var back Untrusted
72 require.NoError(t, json.Unmarshal(b, &back))
73 assert.Equal(t, u.Raw(), back.Raw())
74}
75
76func TestUntrusted_Empty(t *testing.T) {
77 assert.True(t, NewUntrusted("").Empty())

Callers

nothing calls this directly

Calls 3

RawMethod · 0.95
NewUntrustedFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected