return error if RESTIC_COMPRESSION env variable is invalid

This commit is contained in:
Michael Eischer committed 2022-10-29 22:03:39 +02:00
1 parent f8910bc4ff
commit 01f0db4e56
2 files changed
+17 -3

No files matched your search

+8
View File
@@ -679,3 +679,11 @@ func testStreamPack(t *testing.T, version uint) {
}
})
}
func TestInvalidCompression(t *testing.T) {
var comp repository.CompressionMode
err := comp.Set("nope")
rtest.Assert(t, err != nil, "missing error")
_, err = repository.New(nil, repository.Options{Compression: comp})
rtest.Assert(t, err != nil, "missing error")
}