Skip to content

Conversation

willfaught
Copy link
Contributor

Fixed the isEmpty bug with nil pointers.

Changed to adopt behavior consistent with reflection. Note that this is a breaking change, e.g. non-nil slices with length 0 were empty before, and now aren't.

@matryer
Copy link
Member

matryer commented Feb 18, 2015

Hmm, I think an empty slice should be considered empty, don’t you?

On Feb 18, 2015, at 3:33 PM, Will Faught [email protected] wrote:

Fixed the isEmpty bug with nil pointers.

Changed to adopt behavior consistent with reflection. Note that this is a breaking change, e.g. non-nil slices with length 0 were empty before, and now aren't.

You can view, comment on, or merge this pull request online at:

#138 #138
Commit Summary

Fixed isEmpty for pointer types, and simplified it.
File Changes

M assert/assertions.go https://github.com/stretchr/testify/pull/138/files#diff-0 (52)
Patch Links:

https://github.com/stretchr/testify/pull/138.patch https://github.com/stretchr/testify/pull/138.patch
https://github.com/stretchr/testify/pull/138.diff https://github.com/stretchr/testify/pull/138.diff

Reply to this email directly or view it on GitHub #138.

@willfaught willfaught closed this Feb 19, 2015
@willfaught
Copy link
Contributor Author

Sorry, I mistakenly didn't "go get" the tests, so this hasn't been tested, please ignore.

@willfaught
Copy link
Contributor Author

@matryer I guess it depends on the meaning of 'empty'. I can now see what they were going for, so maybe this wasn't a good idea. I was thinking of it working more like a Zero assertion. I'd love to have that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants