MCPcopy Index your code
hub / github.com/rclone/rclone / TestDecodeFileNameBase32768

Function TestDecodeFileNameBase32768

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

Source from the content-addressed store, hash-verified

170}
171
172func TestDecodeFileNameBase32768(t *testing.T) {
173 enc, err := NewNameEncoding("base32768")
174 assert.NoError(t, err, "There should be no error creating name encoder for base32.")
175 // We've tested decoding the valid ones above, now concentrate on the invalid ones
176 for _, test := range []struct {
177 in string
178 expectedErr error
179 }{
180 {"㼿c", base32768.CorruptInputError(1)},
181 {"!", base32768.CorruptInputError(0)},
182 {"㻙ⲿ=㻙ⲿ", base32768.CorruptInputError(2)},
183 } {
184 actual, actualErr := enc.DecodeString(test.in)
185 assert.Equal(t, test.expectedErr, actualErr, fmt.Sprintf("in=%q got actual=%q, err = %v %T", test.in, actual, actualErr, actualErr))
186 }
187}
188
189func testEncryptSegment(t *testing.T, encoding string, testCases []EncodingTestCase, caseInsensitive bool) {
190 enc, _ := NewNameEncoding(encoding)

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…