MCPcopy
hub / github.com/rclone/rclone / TestDecodeFileNameBase32

Function TestDecodeFileNameBase32

backend/crypt/cipher_test.go:138–153  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

136}
137
138func TestDecodeFileNameBase32(t *testing.T) {
139 enc, err := NewNameEncoding("base32")
140 assert.NoError(t, err, "There should be no error creating name encoder for base32.")
141 // We've tested decoding the valid ones above, now concentrate on the invalid ones
142 for _, test := range []struct {
143 in string
144 expectedErr error
145 }{
146 {"64=", ErrorBadBase32Encoding},
147 {"!", base32.CorruptInputError(0)},
148 {"hello=hello", base32.CorruptInputError(5)},
149 } {
150 actual, actualErr := enc.DecodeString(test.in)
151 assert.Equal(t, test.expectedErr, actualErr, fmt.Sprintf("in=%q got actual=%q, err = %v %T", test.in, actual, actualErr, actualErr))
152 }
153}
154
155func TestDecodeFileNameBase64(t *testing.T) {
156 enc, err := NewNameEncoding("base64")

Callers

nothing calls this directly

Calls 3

NewNameEncodingFunction · 0.85
DecodeStringMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…