| 247 | } |
| 248 | |
| 249 | func TestNotSame(t *testing.T) { |
| 250 | |
| 251 | mockT := new(testing.T) |
| 252 | |
| 253 | if !NotSame(mockT, ptr(1), ptr(1)) { |
| 254 | t.Error("NotSame should return true; different pointers") |
| 255 | } |
| 256 | if !NotSame(mockT, 1, 1) { |
| 257 | t.Error("NotSame should return true; constant inputs") |
| 258 | } |
| 259 | p := ptr(2) |
| 260 | if !NotSame(mockT, p, *p) { |
| 261 | t.Error("NotSame should return true; mixed-type inputs") |
| 262 | } |
| 263 | if NotSame(mockT, p, p) { |
| 264 | t.Error("NotSame should return false") |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | func Test_samePointers(t *testing.T) { |
| 269 | p := ptr(2) |