-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 unit test for variance on methods in EitherT #1629
add unit test for variance on methods in EitherT #1629
Conversation
|
||
for { | ||
s1 <- EitherT(either1) | ||
s2 <- EitherT.right[Id, AppError, String]("1".pure[Id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should be able to write EitherT.pure[Id, AppError]("1")
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@jtjeferreira thanks! It looks like there's a compile error in the test:
|
@ceedubs that's very weird because I cant reproduce it locally... |
@jtjeferreira your local branch is probably outdated. |
@jtjeferreira here's how I'm able to reproduce it locally:
I think that we have the fatal warnings flag enabled, so this ends up being a fatal error. Note that it doesn't complain if you use |
8bee97f
to
2e6d78a
Compare
my local branch was outdated, rebased and fixed. waiting for Travis... |
Codecov Report
@@ Coverage Diff @@
## master #1629 +/- ##
=======================================
Coverage 93.37% 93.37%
=======================================
Files 240 240
Lines 3937 3937
Branches 139 138 -1
=======================================
Hits 3676 3676
Misses 261 261 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jtjeferreira!
for { | ||
s1 <- EitherT(either1) | ||
s2 <- EitherT.pure[Id, AppError]("1") | ||
} yield s1 ++ s2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might've missed something but it's not very clear to me why there are all 4 tests needed here. The types of the two EitherT
s in the first, second and last test are exactly the same, aren't they?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kailuowang hi sorry for the late reply. These tests are just to prevent regressions like the one I was going to introduce in #1627 so for the sake of completion I covered the different use cases...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the other hand this was more problematic issue before #1583 was merged...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jtjeferreira I think that there is some value in testing the inference here, and I certainly don't think the extra unit tests hurt anything. 👍 from me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I guess I was just nitpicking.
related to #1627 and #1506