1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-03 09:03:50 +00:00

vfs: re-implement CacheMode with fs.Enum

This almost 100% backwards compatible. The only difference being that
in the rc options/get output CacheMode will be output as strings
instead of integers. This is a lot more convenient for the user. They
still accept integer inputs though so the fallout from this should be
minimal.
This commit is contained in:
Nick Craig-Wood
2023-09-27 15:31:47 +01:00
parent 3092f82dcc
commit 1cc22da87d
2 changed files with 14 additions and 42 deletions

View File

@@ -18,7 +18,7 @@ var _ json.Unmarshaler = (*CacheMode)(nil)
func TestCacheModeString(t *testing.T) {
assert.Equal(t, "off", CacheModeOff.String())
assert.Equal(t, "full", CacheModeFull.String())
assert.Equal(t, "CacheMode(17)", CacheMode(17).String())
assert.Equal(t, "Unknown(17)", CacheMode(17).String())
}
func TestCacheModeSet(t *testing.T) {