(t *testing.T)
| 153 | } |
| 154 | |
| 155 | func 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 | |
| 172 | func TestDecodeFileNameBase32768(t *testing.T) { |
| 173 | enc, err := NewNameEncoding("base32768") |
nothing calls this directly
no test coverage detected
searching dependent graphs…