Merge pull request #3992 from MichaelEischer/err-on-invalid-compression

Return error if RESTIC_COMPRESSION env variable is invalid
This commit is contained in:
Alexander Neumann 2022-11-04 19:41:34 +01:00 committed by GitHub
commit 8dd95b710e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 3 deletions

View file

@ -681,3 +681,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")
}