@@ -118,7 +118,7 @@ func TestTypes(t *testing.T) {
118
118
},
119
119
},
120
120
} {
121
- typ := & Types {test .LHS , test .RHS }
121
+ typ := types {test .LHS , test .RHS }
122
122
123
123
if typ .Diff () != TypesDiffer {
124
124
t .Errorf ("Types.Diff() = %q, expected %q" , typ .Diff (), TypesDiffer )
@@ -159,7 +159,7 @@ func TestScalar(t *testing.T) {
159
159
Type : TypesDiffer ,
160
160
},
161
161
} {
162
- typ := & Scalar {test .LHS , test .RHS }
162
+ typ := scalar {test .LHS , test .RHS }
163
163
164
164
if typ .Diff () != test .Type {
165
165
t .Errorf ("Types.Diff() = %q, expected %q" , typ .Diff (), test .Type )
@@ -223,7 +223,7 @@ func TestSlice(t *testing.T) {
223
223
Type : ContentDiffer ,
224
224
},
225
225
} {
226
- typ , err := NewSlice (test .LHS , test .RHS )
226
+ typ , err := newSlice (test .LHS , test .RHS )
227
227
228
228
if err != nil {
229
229
t .Errorf ("NewSlice(%+v, %+v): unexpected error: %q" , test .LHS , test .RHS , err )
@@ -238,8 +238,8 @@ func TestSlice(t *testing.T) {
238
238
testStrings ("TestSlice" , t , test , ss , indented )
239
239
}
240
240
241
- invalid , err := NewSlice (nil , nil )
242
- if invalidErr , ok := err .(InvalidType ); ok {
241
+ invalid , err := newSlice (nil , nil )
242
+ if invalidErr , ok := err .(ErrInvalidType ); ok {
243
243
if ! strings .Contains (invalidErr .Error (), "nil" ) {
244
244
t .Errorf ("NewSlice(nil, nil): unexpected format for InvalidType error: got %s" , err )
245
245
}
@@ -256,8 +256,8 @@ func TestSlice(t *testing.T) {
256
256
t .Errorf ("invalidSlice.StringIndent(%q, %q, %+v) = %q, expected %q" , testKey , testPrefix , testOutput , indented , "" )
257
257
}
258
258
259
- invalid , err = NewSlice ([]int {}, nil )
260
- if invalidErr , ok := err .(InvalidType ); ok {
259
+ invalid , err = newSlice ([]int {}, nil )
260
+ if invalidErr , ok := err .(ErrInvalidType ); ok {
261
261
if ! strings .Contains (invalidErr .Error (), "nil" ) {
262
262
t .Errorf ("NewSlice([]int{}, nil): unexpected format for InvalidType error: got %s" , err )
263
263
}
@@ -338,7 +338,7 @@ func TestMap(t *testing.T) {
338
338
Type : ContentDiffer ,
339
339
},
340
340
} {
341
- m , err := NewMap (test .LHS , test .RHS )
341
+ m , err := newMap (test .LHS , test .RHS )
342
342
343
343
if err != nil {
344
344
t .Errorf ("NewMap(%+v, %+v): unexpected error: %q" , test .LHS , test .RHS , err )
@@ -353,8 +353,8 @@ func TestMap(t *testing.T) {
353
353
testStrings (fmt .Sprintf ("TestMap[%d]" , i ), t , test , ss , indented )
354
354
}
355
355
356
- invalid , err := NewMap (nil , nil )
357
- if invalidErr , ok := err .(InvalidType ); ok {
356
+ invalid , err := newMap (nil , nil )
357
+ if invalidErr , ok := err .(ErrInvalidType ); ok {
358
358
if ! strings .Contains (invalidErr .Error (), "nil" ) {
359
359
t .Errorf ("NewMap(nil, nil): unexpected format for InvalidType error: got %s" , err )
360
360
}
@@ -371,8 +371,8 @@ func TestMap(t *testing.T) {
371
371
t .Errorf ("invalidMap.StringIndent(%q, %q, %+v) = %q, expected %q" , testKey , testPrefix , testOutput , indented , "" )
372
372
}
373
373
374
- invalid , err = NewMap (map [int ]int {}, nil )
375
- if invalidErr , ok := err .(InvalidType ); ok {
374
+ invalid , err = newMap (map [int ]int {}, nil )
375
+ if invalidErr , ok := err .(ErrInvalidType ); ok {
376
376
if ! strings .Contains (invalidErr .Error (), "nil" ) {
377
377
t .Errorf ("NewMap(map[int]int{}, nil): unexpected format for InvalidType error: got %s" , err )
378
378
}
@@ -391,16 +391,16 @@ func TestMap(t *testing.T) {
391
391
}
392
392
393
393
func TestIgnore (t * testing.T ) {
394
- ignore := Ignore {}
394
+ ignoreDiff , _ := Ignore ()
395
395
396
- if ignore .Diff () != Identical {
397
- t .Errorf ("Ignore{} .Diff() = %q, expected %q" , ignore .Diff (), Identical )
396
+ if ignoreDiff .Diff () != Identical {
397
+ t .Errorf ("NewIgnore() .Diff() = %q, expected %q" , ignoreDiff .Diff (), Identical )
398
398
}
399
- if len (ignore .Strings ()) != 0 {
400
- t .Errorf ("len(Ignore{} .Strings()) = %d, expected 0" , len (ignore .Strings ()))
399
+ if len (ignoreDiff .Strings ()) != 0 {
400
+ t .Errorf ("len(NewIgnore() .Strings()) = %d, expected 0" , len (ignoreDiff .Strings ()))
401
401
}
402
- if indented := ignore .StringIndent (testKey , testPrefix , testOutput ); indented != "" {
403
- t .Errorf ("Ignore{} .StringIndent(...) = %q, expected %q" , indented , "" )
402
+ if indented := ignoreDiff .StringIndent (testKey , testPrefix , testOutput ); indented != "" {
403
+ t .Errorf ("NewIgnore() .StringIndent(...) = %q, expected %q" , indented , "" )
404
404
}
405
405
}
406
406
0 commit comments