From f74613907d5d633b135d17520554bf27eda09bab Mon Sep 17 00:00:00 2001 From: zhouhaibing089 Date: Tue, 31 Oct 2017 16:33:36 +0800 Subject: [PATCH] digestset: refine some words on unit test 1. when lookup an entry which is missing, it should say NotFound. 2. when add duplicated entry, the entries size should be increased. 3. when add entry which has different algorithm, it should be allowed. Signed-off-by: zhouhaibing089 --- digestset/set_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/digestset/set_test.go b/digestset/set_test.go index 89c5729d..67d46c62 100644 --- a/digestset/set_test.go +++ b/digestset/set_test.go @@ -51,7 +51,7 @@ func TestLookup(t *testing.T) { dgst, err = dset.Lookup("9876") if err == nil { - t.Fatal("Expected ambiguous error looking up: 9876") + t.Fatal("Expected not found error looking up: 9876") } if err != ErrDigestNotFound { t.Fatal(err) @@ -118,7 +118,7 @@ func TestAddDuplication(t *testing.T) { } 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 { @@ -126,7 +126,7 @@ func TestAddDuplication(t *testing.T) { } if len(dset.entries) != 9 { - t.Fatal("Insert with different algorithm not allowed") + t.Fatal("Insert with different algorithm should be allowed") } }