MCPcopy
hub / github.com/rclone/rclone / testStandardEncryptFileName

Function testStandardEncryptFileName

backend/crypt/cipher_test.go:342–354  ·  view source on GitHub ↗
(t *testing.T, encoding string, testCasesEncryptDir []EncodingTestCase, testCasesNoEncryptDir []EncodingTestCase)

Source from the content-addressed store, hash-verified

340}
341
342func 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
356func TestStandardEncryptFileNameBase32(t *testing.T) {
357 testStandardEncryptFileName(t, "base32", []EncodingTestCase{

Calls 4

NewNameEncodingFunction · 0.85
newCipherFunction · 0.85
EqualMethod · 0.45
EncryptFileNameMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…