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 EitherT.fromOption #1327

Merged
merged 1 commit into from
Aug 24, 2016
Merged

Conversation

markus1189
Copy link
Contributor

Adds EitherT.fromOption which es the equivalent of Either.fromOption but directly lifts into an Applicative.

@johnynek
Copy link
Contributor

👍

@codecov-io
Copy link

codecov-io commented Aug 23, 2016

Current coverage is 91.47% (diff: 50.00%)

Merging #1327 into master will decrease coverage by 0.07%

@@             master      #1327   diff @@
==========================================
  Files           237        237          
  Lines          3563       3568     +5   
  Methods        3504       3506     +2   
  Messages          0          0          
  Branches         59         61     +2   
==========================================
+ Hits           3262       3264     +2   
- Misses          301        304     +3   
  Partials          0          0          

Sunburst

Powered by Codecov. Last update 3ca2309...50db00c

@johnynek
Copy link
Contributor

looks like we need to add a test to improve coverage.

@markus1189
Copy link
Contributor Author

Yeah I will have a look tomorrow

On Aug 23, 2016 22:51, "P. Oscar Boykin" [email protected] wrote:

looks like we need to add a test to improve coverage.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1327 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAkGz-hiZIVO9TDkDa0JPXStb_Hr91T4ks5qi11YgaJpZM4JrUr-
.

@markus1189
Copy link
Contributor Author

I am pretty sure that the line as reported by codecov is hit. Is there anything special I have to do or does codecov simply not detect this?

@johnynek
Copy link
Contributor

If you look here:

https://codecov.io/gh/typelevel/cats/compare/3ca2309fcb666054211c643dac8f5346224d7ff8...50db00cd02a51f0fcf760e03db857c5a400de7ec

It seems to think: EitherT(F.pure(Either.fromOption(opt, ifNone))) is never exercised.

Can you show where it is tested?

* scala> EitherT.fromOption[List](o, "Answer not known.")
* res0: EitherT[List, String, Int] = EitherT(List(Left(Answer not known.)))
* scala> EitherT.fromOption[List](Some(42), "Answer not known.")
* res1: EitherT[List, String, Int] = EitherT(List(Right(42)))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. In the doctests

@markus1189
Copy link
Contributor Author

@johnynek I added the comments where I exercise that line

@johnynek
Copy link
Contributor

yeah, looks like a bug in code-coverage to me. Or maybe somehow the test is not run.

@kailuowang
Copy link
Contributor

👍 , I agree it looks like a codecov bug that missed the apply methods.

@kailuowang kailuowang merged commit e63c305 into typelevel:master Aug 24, 2016
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