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
Expect inequality #10
Comments
Originally motivated by hspec/hspec#174. We have a PR that adds |
+1 from me. |
i'm a bit torn - it would be convenient, but it does sort of encourage bad tests. |
@mwotton I think this is my main concern. I'm tempted to just add
and can be useful in other context, e.g.
|
+1, i like shouldNotSatisfy |
Compare: Matrix
[1, 2, 3
, 4, 5, 6
, 7, 8, 8]
`shouldNotBe`
Matrix
[1, 2, 3
, 4, 5, 6
, 7, 8, 9] to: Matrix
[1, 2, 3
, 4, 5, 6
, 7, 8, 8]
`shouldSatisfy`
(/=
Matrix
[1, 2, 3
, 4, 5, 6
, 7, 8, 9] )
I really don't see the problems and I can see some benefits. |
Do you know what a double negative is? |
@Jefffrey You can change `shouldNotSatisfy` (not . (== ...)) to `shouldSatisfy` (/= ..) |
It makes it easier to write something you probably shouldn't write 99% of On Tue, Jul 1, 2014 at 7:34 PM, Jeffrey Pigarelli notifications@github.com
A UNIX signature isn't a return address, it's the ASCII equivalent of a |
@mwotton + the test that "rules out all but one" is much better as documentation. |
actually, only one of those was written after your example. You might want to steady on with the wild accusations of hubris. as far as your test case goes, a QC property that shows that changing any given cell invalidates the equality of a matrix would be infinitely better anyway. |
Sure, but this is a Haskell testing lib. We're not bound by the lowest common denominator of languages. Not sure what you mean by your second point. That is testing for inequality, no? (I assumed you were talking about some clever manual Eq instance rather than automatically derived ones, otherwise yes, it would be a bit pointless.) |
I think it's fine in the context of a QC property, yeah. |
I think you may have missed where the burden of proof lies here. You're proposing a change: you need to find an example where there isn't an unambiguously better alternative. You proposed an example, I showed a better alternative. |
good discussion here. the only input i'd add is that for UI tests, ime, shouldNot can be helpful. that type of matcher is in jasmine-jquery, for instance. |
People, sorry for sitting on that patch. I'll make an educated decision as soon as I have some time to spend on this. |
My final opinion on this, let's add them to @Jefffrey Can you update your PR? |
Solved by #11. |
Currently, if you want to state that two things are different, you can use something like:
Do we want to have a separate combinator for that, so that you can say:
If yes, should we also add
shouldNotContain
,shouldNotSatisfy
andshouldNotReturn
?The text was updated successfully, but these errors were encountered: