Skip to content

Commit

Permalink
Adds helper to create Shrink using LazyList
Browse files Browse the repository at this point in the history
This allows to use Shrink from scala 2.13 without getting deprecation
warnings on scala.collection.immutable.Stream
  • Loading branch information
froth committed Feb 13, 2020
1 parent cddf22f commit a55c651
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/scala-2.13+/org/scalacheck/LazyListShrink.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*-------------------------------------------------------------------------*\
** ScalaCheck **
** Copyright (c) 2007-2019 Rickard Nilsson. All rights reserved. **
** http://www.scalacheck.org **
** **
** This software is released under the terms of the Revised BSD License. **
** There is NO WARRANTY. See the file LICENSE for the full text. **
\*------------------------------------------------------------------------ */
package org.scalacheck

/**
* Compatibility helper to create Shrinks using LazyList
*/
object LazyListShrink {
/** Forward to Shrink instance factory */
def apply[T](s: T => LazyList[T]): Shrink[T] = Shrink(s.andThen(_.toStream))
}

0 comments on commit a55c651

Please sign in to comment.