digester_resumable_test.go 511 B

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