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

Eliminated two possible false positives from BlockingObservableTest #178

Merged
merged 2 commits into from Oct 11, 2015

Conversation

illusioni
Copy link
Contributor

No description provided.

@zsxwing
Copy link
Member

zsxwing commented Oct 6, 2015

Could you clarify why you need to change them, such as provide an example of false positives?

@illusioni
Copy link
Contributor Author

Hi Shixiong Zhu,
The existing test is wrong because it does not test all that's specified.
It only works because the component under test (CUT) behaves well.
In the case of the "toFuture function throwing rather than producing a failing future" the existing test would still succeed (that's the false positive).
My version of the test would fail - as a test should when the CUT does not comply with the spec.
Hope that info helps. :-)
Big fan of Rx by now...
Klaus
On Oct 6, 2015 17:00, Shixiong Zhu notifications@github.com wrote:Could you clarify why you need to change them, such as provide an example of false positives?

—Reply to this email directly or view it on GitHub.

val future = o.toBlocking.toFuture //if this were to throw the original test would wrongly succeed
Await.result(future.failed, 10 seconds) match {
case t:IllegalArgumentException => //this is what we expect
case _ => fail("expected the future to fail with a NoSuchElementException")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: NoSuchElementException -> IllegalArgumentException

@zsxwing
Copy link
Member

zsxwing commented Oct 11, 2015

@illusioni Thanks for your clarification. I will merge this PR once you fix the typo.

@illusioni
Copy link
Contributor Author

I tried hard, @zsxwing, but I can't find a typo in my changes.
Please let me know where you see an error

@illusioni
Copy link
Contributor Author

Aaah. Is this what you meant?

zsxwing added a commit that referenced this pull request Oct 11, 2015
eliminated two possible false positives from BlockingObservableTest
@zsxwing zsxwing merged commit df5dcc1 into ReactiveX:0.x Oct 11, 2015
@zsxwing
Copy link
Member

zsxwing commented Oct 11, 2015

@illusioni Exactly. Thanks! Merged.

@zsxwing zsxwing changed the title eliminated two possible false positives from BlockingObservableTest Eliminated two possible false positives from BlockingObservableTest Dec 17, 2015
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.

None yet

2 participants