mirror of
https://github.com/distribution/distribution.git
synced 2025-07-13 15:14:12 +00:00
Merge pull request #2435 from zhouhaibing089/digestset-ut
digestset: refine some words on unit test
This commit is contained in:
commit
bc3c7b0525
@ -51,7 +51,7 @@ func TestLookup(t *testing.T) {
|
|||||||
|
|
||||||
dgst, err = dset.Lookup("9876")
|
dgst, err = dset.Lookup("9876")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatal("Expected ambiguous error looking up: 9876")
|
t.Fatal("Expected not found error looking up: 9876")
|
||||||
}
|
}
|
||||||
if err != ErrDigestNotFound {
|
if err != ErrDigestNotFound {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@ -118,7 +118,7 @@ func TestAddDuplication(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(dset.entries) != 8 {
|
if len(dset.entries) != 8 {
|
||||||
t.Fatal("Duplicate digest insert allowed")
|
t.Fatal("Duplicate digest insert should not increase entries size")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := dset.Add(digest.Digest("sha384:123451111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111")); err != nil {
|
if err := dset.Add(digest.Digest("sha384:123451111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111")); err != nil {
|
||||||
@ -126,7 +126,7 @@ func TestAddDuplication(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(dset.entries) != 9 {
|
if len(dset.entries) != 9 {
|
||||||
t.Fatal("Insert with different algorithm not allowed")
|
t.Fatal("Insert with different algorithm should be allowed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user