Skip to content

Commit

Permalink
Deprecating separately
Browse files Browse the repository at this point in the history
  • Loading branch information
durban committed Oct 17, 2017
1 parent 7a41804 commit f18b06f
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import cats.data.{NonEmptyList, NonEmptyVector}
import cats.laws.discipline.arbitrary._
import cats.laws.discipline.{ComonadTests, NonEmptyTraverseTests, MonadTests, ReducibleTests, SemigroupKTests, SerializableTests}

@deprecated("to be able to test deprecated methods", since = "1.0.0-RC1")
class NonEmptyListTests extends CatsSuite {
// Lots of collections here.. telling ScalaCheck to calm down a bit
implicit override val generatorDrivenConfig: PropertyCheckConfiguration =
Expand Down Expand Up @@ -289,7 +288,6 @@ class NonEmptyListTests extends CatsSuite {
forAll { (nel: NonEmptyList[Int], l: List[Int], n: Int) =>
(nel ++ l).toList should === (nel.toList ::: l)
nel.concat(l).toList should === (nel.toList ::: l)
nel.concat(NonEmptyList(n, l)).toList should === (nel.toList ::: (n :: l))
nel.concatNel(NonEmptyList(n, l)).toList should === (nel.toList ::: (n :: l))
}
}
Expand Down Expand Up @@ -324,6 +322,16 @@ class NonEmptyListTests extends CatsSuite {
}
}

@deprecated("to be able to test deprecated methods", since = "1.0.0-RC1")
class DeprecatedNonEmptyListTests extends CatsSuite {

test("Deprecated NonEmptyList#concat is consistent with List#:::") {
forAll { (nel: NonEmptyList[Int], l: List[Int], n: Int) =>
nel.concat(NonEmptyList(n, l)).toList should === (nel.toList ::: (n :: l))
}
}
}

class ReducibleNonEmptyListCheck extends ReducibleCheck[NonEmptyList]("NonEmptyList") {
def iterator[T](nel: NonEmptyList[T]): Iterator[T] = nel.toList.iterator

Expand Down

0 comments on commit f18b06f

Please sign in to comment.