Skip to content

Commit

Permalink
Golf: more traverseFilter (#274)
Browse files Browse the repository at this point in the history
There is only one spot left with `traverse` with some complicated logic
  • Loading branch information
Masynchin authored Feb 6, 2025
2 parents 64bd54f + b61ef27 commit ad7cc07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/crawler/src/test/scala/ParserTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ object ParserTest extends SimpleIOSuite:
"1478800 Aagaard, Christian DEN M 1999 "
)
lines
.traverse(parse)
.map(_.flatMap(_.map(_.active)))
.traverseFilter(parse)
.map(_.map(_.active))
.map(expect.same(_, List(false, false, true, true)))

test("rating constraints"):
Expand All @@ -38,8 +38,8 @@ object ParserTest extends SimpleIOSuite:
"10001492 Ojok, Patrick UGA M FI,LSI 2700 0 20 1932 0 20 1926 0 20 1974 "
)
lines
.traverse(parse)
.map(_.flatMap(_.flatMap(_.standard)))
.traverseFilter(parse)
.map(_.flatMap(_.standard))
.map(expect.same(_, List(2700)))

test("sanitize name"):
Expand Down

0 comments on commit ad7cc07

Please sign in to comment.