()
| 194 | } |
| 195 | |
| 196 | func 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 | }, { |
no test coverage detected