github.com/npaton/distribution@v2.3.1-rc.0+incompatible/digest/digester_resumable_test.go (about)

     1  // +build !noresumabledigest
     2  
     3  package digest
     4  
     5  import (
     6  	"testing"
     7  
     8  	"github.com/stevvooe/resumable"
     9  	_ "github.com/stevvooe/resumable/sha256"
    10  )
    11  
    12  // TestResumableDetection just ensures that the resumable capability of a hash
    13  // is exposed through the digester type, which is just a hash plus a Digest
    14  // method.
    15  func TestResumableDetection(t *testing.T) {
    16  	d := Canonical.New()
    17  
    18  	if _, ok := d.Hash().(resumable.Hash); !ok {
    19  		t.Fatalf("expected digester to implement resumable.Hash: %#v, %v", d, d.Hash())
    20  	}
    21  }