(t *testing.T, encoding string, testCasesEncryptDir []EncodingTestCase, testCasesNoEncryptDir []EncodingTestCase)
| 340 | } |
| 341 | |
| 342 | func testStandardEncryptFileName(t *testing.T, encoding string, testCasesEncryptDir []EncodingTestCase, testCasesNoEncryptDir []EncodingTestCase) { |
| 343 | // First standard mode |
| 344 | enc, _ := NewNameEncoding(encoding) |
| 345 | c, _ := newCipher(NameEncryptionStandard, "", "", true, enc) |
| 346 | for _, test := range testCasesEncryptDir { |
| 347 | assert.Equal(t, test.expected, c.EncryptFileName(test.in)) |
| 348 | } |
| 349 | // Standard mode with directory name encryption off |
| 350 | c, _ = newCipher(NameEncryptionStandard, "", "", false, enc) |
| 351 | for _, test := range testCasesNoEncryptDir { |
| 352 | assert.Equal(t, test.expected, c.EncryptFileName(test.in)) |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | func TestStandardEncryptFileNameBase32(t *testing.T) { |
| 357 | testStandardEncryptFileName(t, "base32", []EncodingTestCase{ |
no test coverage detected
searching dependent graphs…