MCPcopy
hub / github.com/google/go-cmp / comparerTests

Function comparerTests

cmp/compare_test.go:196–714  ·  cmp/compare_test.go::comparerTests
()

Source from the content-addressed store, hash-verified

194}
195
196func comparerTests() []test {
197 const label = "Comparer"
198
199 type Iface1 interface {
200 Method()
201 }
202 type Iface2 interface {
203 Method()
204 }
205
206 type tarHeader struct {
207 Name string
208 Mode int64
209 Uid int
210 Gid int
211 Size int64
212 ModTime time.Time
213 Typeflag byte
214 Linkname string
215 Uname string
216 Gname string
217 Devmajor int64
218 Devminor int64
219 AccessTime time.Time
220 ChangeTime time.Time
221 Xattrs map[string]string
222 }
223
224 type namedWithUnexported struct {
225 unexported string
226 }
227
228 makeTarHeaders := func(tf byte) (hs []tarHeader) {
229 for i := 0; i < 5; i++ {
230 hs = append(hs, tarHeader{
231 Name: fmt.Sprintf("some/dummy/test/file%d", i),
232 Mode: 0664, Uid: i * 1000, Gid: i * 1000, Size: 1 << uint(i),
233 ModTime: now.Add(time.Duration(i) * time.Hour),
234 Uname: "user", Gname: "group",
235 Typeflag: tf,
236 })
237 }
238 return hs
239 }
240
241 return []test{{
242 label: label + "/Nil",
243 x: nil,
244 y: nil,
245 wantEqual: true,
246 reason: "nils are equal",
247 }, {
248 label: label + "/Integer",
249 x: 1,
250 y: 1,
251 wantEqual: true,
252 reason: "identical integers are equal",
253 }, {

Callers 1

TestDiffFunction · 0.85

Calls 13

IgnoreFunction · 0.92
ComparerFunction · 0.92
TransformerFunction · 0.92
FilterPathFunction · 0.92
FilterValuesFunction · 0.92
AllowUnexportedFunction · 0.92
EquateErrorsFunction · 0.92
newIntFunction · 0.85
LastMethod · 0.80
TypeMethod · 0.65
StringMethod · 0.65
ValuesMethod · 0.65

Tested by

no test coverage detected