(t *testing.T)
| 170 | } |
| 171 | |
| 172 | func 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 | |
| 189 | func testEncryptSegment(t *testing.T, encoding string, testCases []EncodingTestCase, caseInsensitive bool) { |
| 190 | enc, _ := NewNameEncoding(encoding) |
nothing calls this directly
no test coverage detected
searching dependent graphs…