From a915d8083d75dd260418ba4de03cb82a9b579b41 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Tue, 10 Dec 2019 09:13:54 -0600 Subject: [PATCH] Rename rangeE for clarity --- .../test/scala-2.12/cats/tests/NonEmptyStreamSuite.scala | 3 +-- .../test/scala-2.13+/cats/tests/NonEmptyLazyListSuite.scala | 3 +-- tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala | 3 +-- tests/src/test/scala/cats/tests/NonEmptyListSuite.scala | 3 +-- tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala | 3 +-- tests/src/test/scala/cats/tests/ReducibleSuite.scala | 6 +++--- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/tests/src/test/scala-2.12/cats/tests/NonEmptyStreamSuite.scala b/tests/src/test/scala-2.12/cats/tests/NonEmptyStreamSuite.scala index 4e4e779aba..dc832b5b06 100644 --- a/tests/src/test/scala-2.12/cats/tests/NonEmptyStreamSuite.scala +++ b/tests/src/test/scala-2.12/cats/tests/NonEmptyStreamSuite.scala @@ -167,6 +167,5 @@ class ReducibleNonEmptyStreamSuite extends ReducibleSuite[NonEmptyStream]("NonEm NonEmptyStream(start, tailStart.to(endInclusive).toStream) } - def rangeE[L, R](el: Either[L, R], els: Either[L, R]*): NonEmptyStream[Either[L, R]] = - NonEmptyStream(el, els: _*) + def fromValues[A](el: A, els: A*): NonEmptyStream[A] = NonEmptyStream(el, els: _*) } diff --git a/tests/src/test/scala-2.13+/cats/tests/NonEmptyLazyListSuite.scala b/tests/src/test/scala-2.13+/cats/tests/NonEmptyLazyListSuite.scala index 1887844853..f30a03ee52 100644 --- a/tests/src/test/scala-2.13+/cats/tests/NonEmptyLazyListSuite.scala +++ b/tests/src/test/scala-2.13+/cats/tests/NonEmptyLazyListSuite.scala @@ -138,6 +138,5 @@ class ReducibleNonEmptyLazyListSuite extends ReducibleSuite[NonEmptyLazyList]("N def range(start: Long, endInclusive: Long): NonEmptyLazyList[Long] = NonEmptyLazyList(start, (start + 1L).to(endInclusive): _*) - def rangeE[L, R](el: Either[L, R], els: Either[L, R]*): NonEmptyLazyList[Either[L, R]] = - NonEmptyLazyList(el, els: _*) + def fromValues[A](el: A, els: A*): NonEmptyLazyList[A] = NonEmptyLazyList(el, els: _*) } diff --git a/tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala b/tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala index 5cdf19dbba..4dcda271ec 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala @@ -162,6 +162,5 @@ class ReducibleNonEmptyChainSuite extends ReducibleSuite[NonEmptyChain]("NonEmpt def range(start: Long, endInclusive: Long): NonEmptyChain[Long] = NonEmptyChain(start, (start + 1L).to(endInclusive): _*) - def rangeE[L, R](el: Either[L, R], els: Either[L, R]*): NonEmptyChain[Either[L, R]] = - NonEmptyChain(el, els: _*) + def fromValues[A](el: A, els: A*): NonEmptyChain[A] = NonEmptyChain(el, els: _*) } diff --git a/tests/src/test/scala/cats/tests/NonEmptyListSuite.scala b/tests/src/test/scala/cats/tests/NonEmptyListSuite.scala index c2ef65ae76..55bc71357a 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyListSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyListSuite.scala @@ -370,6 +370,5 @@ class ReducibleNonEmptyListSuite extends ReducibleSuite[NonEmptyList]("NonEmptyL NonEmptyList(start, (tailStart).to(endInclusive).toList) } - def rangeE[L, R](el: Either[L, R], els: Either[L, R]*): NonEmptyList[Either[L, R]] = - NonEmptyList(el, List(els: _*)) + def fromValues[A](el: A, els: A*): NonEmptyList[A] = NonEmptyList(el, List(els: _*)) } diff --git a/tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala b/tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala index 7577645920..eb04f48bc4 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala @@ -404,6 +404,5 @@ class ReducibleNonEmptyVectorSuite extends ReducibleSuite[NonEmptyVector]("NonEm NonEmptyVector(start, (tailStart).to(endInclusive).toVector) } - def rangeE[L, R](el: Either[L, R], els: Either[L, R]*): NonEmptyVector[Either[L, R]] = - NonEmptyVector(el, Vector(els: _*)) + def fromValues[A](el: A, els: A*): NonEmptyVector[A] = NonEmptyVector(el, Vector(els: _*)) } diff --git a/tests/src/test/scala/cats/tests/ReducibleSuite.scala b/tests/src/test/scala/cats/tests/ReducibleSuite.scala index 88ab34a2ec..f7ebfc1d90 100644 --- a/tests/src/test/scala/cats/tests/ReducibleSuite.scala +++ b/tests/src/test/scala/cats/tests/ReducibleSuite.scala @@ -106,7 +106,7 @@ abstract class ReducibleSuite[F[_]: Reducible](name: String)(implicit ArbFInt: A extends FoldableSuite[F](name) { def range(start: Long, endInclusive: Long): F[Long] - def rangeE[L, R](el: Either[L, R], els: Either[L, R]*): F[Either[L, R]] + def fromValues[A](el: A, els: A*): F[A] test(s"Reducible[$name].reduceLeftM stack safety") { def nonzero(acc: Long, x: Long): Option[Long] = @@ -120,13 +120,13 @@ abstract class ReducibleSuite[F[_]: Reducible](name: String)(implicit ArbFInt: A test(s"Reducible[$name].reduceA successful case") { val expected = 6 - val actual = rangeE(1.asRight[String], 2.asRight[String], 3.asRight[String]).reduceA + val actual = fromValues(1.asRight[String], 2.asRight[String], 3.asRight[String]).reduceA actual should ===(expected.asRight[String]) } test(s"Reducible[$name].reduceA failure case") { val expected = "boom!!!" - val actual = rangeE(1.asRight, "boom!!!".asLeft, 3.asRight).reduceA + val actual = fromValues(1.asRight, "boom!!!".asLeft, 3.asRight).reduceA actual should ===(expected.asLeft[Int]) }