2015-05-21 06:44:08 +00:00
|
|
|
// +build !noresumabledigest
|
|
|
|
|
2016-12-17 00:28:34 +00:00
|
|
|
package storage
|
2015-05-21 06:44:08 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2016-12-17 00:28:34 +00:00
|
|
|
digest "github.com/opencontainers/go-digest"
|
2015-05-21 06:44:08 +00:00
|
|
|
"github.com/stevvooe/resumable"
|
|
|
|
_ "github.com/stevvooe/resumable/sha256"
|
|
|
|
)
|
|
|
|
|
|
|
|
// TestResumableDetection just ensures that the resumable capability of a hash
|
|
|
|
// is exposed through the digester type, which is just a hash plus a Digest
|
|
|
|
// method.
|
|
|
|
func TestResumableDetection(t *testing.T) {
|
2016-12-17 00:28:34 +00:00
|
|
|
d := digest.Canonical.Digester()
|
2015-05-21 06:44:08 +00:00
|
|
|
|
|
|
|
if _, ok := d.Hash().(resumable.Hash); !ok {
|
2015-05-22 01:44:08 +00:00
|
|
|
t.Fatalf("expected digester to implement resumable.Hash: %#v, %v", d, d.Hash())
|
2015-05-21 06:44:08 +00:00
|
|
|
}
|
|
|
|
}
|