File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -59,29 +59,26 @@ func TestWithIndex(t *testing.T) {
5959}
6060
6161func TestNewDigester (t * testing.T ) {
62- g := NewWithT (t )
63-
6462 t .Run ("default" , func (t * testing.T ) {
63+ g := NewWithT (t )
64+
6565 d := NewDigester ()
66+
6667 g .Expect (d ).ToNot (BeNil ())
67- g .Expect (d .index ).To ( BeEmpty ())
68+ g .Expect (d .index ).ToNot ( BeNil ())
6869 g .Expect (d .digests ).ToNot (BeNil ())
6970 })
7071
7172 t .Run ("with index" , func (t * testing.T ) {
72- initialIndex := map [string ]string {"foo" : "bar" }
73- d := NewDigester (WithIndex (initialIndex ))
73+ g := NewWithT (t )
74+
75+ i := map [string ]string {"foo" : "bar" }
76+ d := NewDigester (WithIndex (i ))
77+
7478 g .Expect (d ).ToNot (BeNil ())
75- g .Expect (d .index ).To (Equal (initialIndex ))
79+ g .Expect (d .index ).To (Equal (i ))
7680 g .Expect (d .digests ).ToNot (BeNil ())
7781 })
78-
79- t .Run ("handles multiple WithIndex options, applying last one" , func (t * testing.T ) {
80- firstIndex := map [string ]string {"a" : "b" }
81- secondIndex := map [string ]string {"c" : "d" }
82- d := NewDigester (WithIndex (firstIndex ), WithIndex (secondIndex ))
83- g .Expect (d .index ).To (Equal (secondIndex ))
84- })
8582}
8683
8784func TestDigester_Add (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments