Skip to content

NotSame should fail if args are not pointers #1661

Closed
@brackendawson

Description

Discussed in #1660

Originally posted by n4nn31355 October 16, 2024
It's confusing and error-prone that NotSame checks nothing if any of the values is not a pointer.
Is there a reason for this, or may we consider it a bug that needs an issue?

a := struct{ byte }{}
require.NotSame(t, a, a)   // Doesn't fail
require.NotSame(t, &a, &a) // Fails
```</div>

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions