Skip to content

Commit

Permalink
repeat until/whilst are combinable with times (#272)
Browse files Browse the repository at this point in the history
* repeat until/whilst are combinable with `times`

* toSetMutable for scala3
  • Loading branch information
mpollmeier authored Jan 17, 2022
1 parent 316765a commit d145bba
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ class RepeatTraversalTests extends AnyWordSpec {
centerTrav.repeat(_.out)(_.until(_.hasLabel(Thing.Label))).property(Name).toSetMutable shouldBe expectedResults
centerTrav.repeat(_.out)(_.until(_.hasLabel(Thing.Label)).breadthFirstSearch).property(Name).toSetMutable shouldBe expectedResults
}

"be combinable with `.times`" in {
centerTrav.repeat(_.followedBy)(_.until(_.name("R2")).times(3)).name.toSetMutable shouldBe Set("L3", "R2")
}

}

"support repeat/while behaviour" should {
Expand Down Expand Up @@ -149,6 +154,10 @@ class RepeatTraversalTests extends AnyWordSpec {
Seq(center, l1),
)
}

"be combinable with `.times`" in {
centerTrav.repeat(_.followedBy)(_.whilst(_.nameNot("R2")).times(3)).name.toSetMutable shouldBe Set("L3", "R2")
}
}

".dedup should apply to all repeat iterations" when {
Expand Down

0 comments on commit d145bba

Please sign in to comment.