From f18b06ff4de48034f0facae6156a2436ca7a9c92 Mon Sep 17 00:00:00 2001 From: Daniel Urban Date: Wed, 11 Oct 2017 19:26:26 +0200 Subject: [PATCH] Deprecating separately --- ...nEmptyListTests.scala => nonEmptyListTests.scala} | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) rename tests/src/test/scala/cats/tests/{NonEmptyListTests.scala => nonEmptyListTests.scala} (98%) diff --git a/tests/src/test/scala/cats/tests/NonEmptyListTests.scala b/tests/src/test/scala/cats/tests/nonEmptyListTests.scala similarity index 98% rename from tests/src/test/scala/cats/tests/NonEmptyListTests.scala rename to tests/src/test/scala/cats/tests/nonEmptyListTests.scala index c1774d76f8..225f7a5f0e 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyListTests.scala +++ b/tests/src/test/scala/cats/tests/nonEmptyListTests.scala @@ -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 = @@ -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)) } } @@ -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