Skip to content
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