Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions assert/assertions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,15 @@ func TestNotSame(t *testing.T) {
if !NotSame(mockT, 1, 1) {
t.Error("NotSame should return true; constant inputs")
}
if NotSame(mockT, (*int)(nil), (*int)(nil)) {
t.Error("NotSame should return false; same nil pointers")
}
if !NotSame(mockT, (*int)(nil), ptr(1)) {
t.Error("NotSame should return true; nil and non-nil pointers")
}
if !NotSame(mockT, (*int)(nil), (*string)(nil)) {
t.Error("NotSame should return true; different nil pointer types")
}
p := ptr(2)
if !NotSame(mockT, p, *p) {
t.Error("NotSame should return true; mixed-type inputs")
Expand Down