MCPcopy
hub / github.com/rclone/rclone / TestDecodeFileNameBase64

Function TestDecodeFileNameBase64

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

Source from the content-addressed store, hash-verified

153}
154
155func TestDecodeFileNameBase64(t *testing.T) {
156 enc, err := NewNameEncoding("base64")
157 assert.NoError(t, err, "There should be no error creating name encoder for base32.")
158 // We've tested decoding the valid ones above, now concentrate on the invalid ones
159 for _, test := range []struct {
160 in string
161 expectedErr error
162 }{
163 {"64=", base64.CorruptInputError(2)},
164 {"!", base64.CorruptInputError(0)},
165 {"Hello=Hello", base64.CorruptInputError(5)},
166 } {
167 actual, actualErr := enc.DecodeString(test.in)
168 assert.Equal(t, test.expectedErr, actualErr, fmt.Sprintf("in=%q got actual=%q, err = %v %T", test.in, actual, actualErr, actualErr))
169 }
170}
171
172func TestDecodeFileNameBase32768(t *testing.T) {
173 enc, err := NewNameEncoding("base32768")

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…