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 a failing test for eachWhere vs closure #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ class ModifyEachWhereTest extends FlatSpec with Matchers {
x4.modify(_.x5.eachWhere(_ => false).name).using(duplicate) should be(x4)
}

it should "modify be able to eachWhere a lambda" in {
val foo = true
x4.modify(_.x5.eachWhere(_ => foo).name).using(duplicate) should be(x4dup)
val bar = false
x4.modify(_.x5.eachWhere(_ => bar).name).using(duplicate) should be(x4)
}

it should "not modify an optional case class field if it is none regardless of the condition" in {
modify(x4none)(_.x5.eachWhere(_ => true).name).using(duplicate) should be(
x4none)
Expand Down