MCPcopy Create free account
hub / github.com/quay/clair / TestBase64

Function TestBase64

config/auth_test.go:14–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestBase64(t *testing.T) {
15 roundtrip := func(in []byte) bool {
16 b1 := config.Base64(in)
17 txt, err := b1.MarshalText()
18 if err != nil {
19 return false
20 }
21 out := new(config.Base64)
22 if err := out.UnmarshalText(txt); err != nil {
23 return false
24 }
25 return bytes.Equal(in, []byte(*out))
26 }
27 if err := quick.Check(roundtrip, nil); err != nil {
28 t.Error(err)
29 }
30}
31
32func TestAuthUnmarshal(t *testing.T) {
33 t.Run("PSK", func(t *testing.T) {

Callers

nothing calls this directly

Calls 4

CheckMethod · 0.65
MarshalTextMethod · 0.45
UnmarshalTextMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected