summaryrefslogtreecommitdiff
path: root/vendor/github.com/docker/distribution/digest/digester_resumable_test.go
blob: 6ba21c801a8f3ae0d188da6521ab76689f24ac27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// +build !noresumabledigest

package digest

import (
	"testing"

	"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) {
	d := Canonical.New()

	if _, ok := d.Hash().(resumable.Hash); !ok {
		t.Fatalf("expected digester to implement resumable.Hash: %#v, %v", d, d.Hash())
	}
}