(t *testing.T)
| 19 | ) |
| 20 | |
| 21 | func TestNewNameEncryptionMode(t *testing.T) { |
| 22 | for _, test := range []struct { |
| 23 | in string |
| 24 | expected NameEncryptionMode |
| 25 | expectedErr string |
| 26 | }{ |
| 27 | {"off", NameEncryptionOff, ""}, |
| 28 | {"standard", NameEncryptionStandard, ""}, |
| 29 | {"obfuscate", NameEncryptionObfuscated, ""}, |
| 30 | {"potato", NameEncryptionOff, "unknown file name encryption mode \"potato\""}, |
| 31 | } { |
| 32 | actual, actualErr := NewNameEncryptionMode(test.in) |
| 33 | assert.Equal(t, actual, test.expected) |
| 34 | if test.expectedErr == "" { |
| 35 | assert.NoError(t, actualErr) |
| 36 | } else { |
| 37 | assert.EqualError(t, actualErr, test.expectedErr) |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | func TestNewNameEncryptionModeString(t *testing.T) { |
| 43 | assert.Equal(t, NameEncryptionOff.String(), "off") |
nothing calls this directly
no test coverage detected
searching dependent graphs…