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) {
59
59
}
60
60
61
61
func TestNewDigester (t * testing.T ) {
62
- g := NewWithT (t )
63
-
64
62
t .Run ("default" , func (t * testing.T ) {
63
+ g := NewWithT (t )
64
+
65
65
d := NewDigester ()
66
+
66
67
g .Expect (d ).ToNot (BeNil ())
67
- g .Expect (d .index ).To ( BeEmpty ())
68
+ g .Expect (d .index ).ToNot ( BeNil ())
68
69
g .Expect (d .digests ).ToNot (BeNil ())
69
70
})
70
71
71
72
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
+
74
78
g .Expect (d ).ToNot (BeNil ())
75
- g .Expect (d .index ).To (Equal (initialIndex ))
79
+ g .Expect (d .index ).To (Equal (i ))
76
80
g .Expect (d .digests ).ToNot (BeNil ())
77
81
})
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
- })
85
82
}
86
83
87
84
func TestDigester_Add (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments