(t *testing.T)
| 136 | } |
| 137 | |
| 138 | func 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 | |
| 155 | func TestDecodeFileNameBase64(t *testing.T) { |
| 156 | enc, err := NewNameEncoding("base64") |
nothing calls this directly
no test coverage detected
searching dependent graphs…