@@ -119,8 +119,8 @@ func TestBoltCacheTimeout(t *testing.T) {
119
119
}
120
120
comparePackageTree (t , ptree , got )
121
121
122
- gotV := c .getAllVersions ()
123
- if len (gotV ) != len (pvs ) {
122
+ gotV , ok := c .getAllVersions ()
123
+ if ! ok || len (gotV ) != len (pvs ) {
124
124
t .Errorf ("unexpected versions:\n \t (GOT): %#v\n \t (WNT): %#v" , gotV , pvs )
125
125
} else {
126
126
SortPairedForDowngrade (gotV )
@@ -161,8 +161,8 @@ func TestBoltCacheTimeout(t *testing.T) {
161
161
}
162
162
comparePackageTree (t , ptree , gotPtree )
163
163
164
- pvs := c .getAllVersions ()
165
- if len (pvs ) > 0 {
164
+ pvs , ok := c .getAllVersions ()
165
+ if ok || len (pvs ) > 0 {
166
166
t .Errorf ("expected no cached versions, but got:\n \t %#v" , pvs )
167
167
}
168
168
}
@@ -194,8 +194,8 @@ func TestBoltCacheTimeout(t *testing.T) {
194
194
}
195
195
comparePackageTree (t , ptree , got )
196
196
197
- gotV := c .getAllVersions ()
198
- if len (gotV ) != len (pvs ) {
197
+ gotV , ok := c .getAllVersions ()
198
+ if ! ok || len (gotV ) != len (pvs ) {
199
199
t .Errorf ("unexpected versions:\n \t (GOT): %#v\n \t (WNT): %#v" , gotV , pvs )
200
200
} else {
201
201
SortPairedForDowngrade (gotV )
@@ -282,8 +282,8 @@ func TestBoltCacheTimeout(t *testing.T) {
282
282
}
283
283
comparePackageTree (t , newPtree , got )
284
284
285
- gotV := c .getAllVersions ()
286
- if len (gotV ) != len (newPVS ) {
285
+ gotV , ok := c .getAllVersions ()
286
+ if ! ok || len (gotV ) != len (newPVS ) {
287
287
t .Errorf ("unexpected versions:\n \t (GOT): %#v\n \t (WNT): %#v" , gotV , newPVS )
288
288
} else {
289
289
SortPairedForDowngrade (gotV )
0 commit comments