Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checkers isTrue and isFalse. #20

Closed

Conversation

santegoeds
Copy link

Add checkers IsTrue & IsFalse.

Use :

c.Assert(0 < 1, IsTrue)
c.Assert(0 > 1, IsFalse)

instead of:

c.Assert(0 < 1, Equals, true)
c.Assert(0 > 1, Equals, false)

@dlsniper
Copy link

@niemeyer any updates for this? Thank you.

@niemeyer
Copy link
Contributor

Please see the discussion on #6.

@niemeyer
Copy link
Contributor

I'm not closing this yet, though, to give room for further input.

@ryanbrainard
Copy link

I would love to see this merged. When using this library, I'm routinely surprised it does not exist. I know it's only a few less characters, but it just feels so much more natural to say IsTrue.

It kind of reminds me of the difference between:

if foo == true {
   ...
}

vs

if foo {
   ...
}

Of course the first way works, but it looks silly and unnecessary. It would be great if the assertion could be just as terse to say c.Assert(0 < 1), but that's not going to work with the method signature, so I see c.Assert(0 < 1, IsTrue) as good as it's going to get.

@santegoeds santegoeds mentioned this pull request Aug 8, 2015
@santegoeds
Copy link
Author

Closing... Five years should've been enough time for gathering feedback.

@santegoeds santegoeds closed this Sep 17, 2019
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.

4 participants