From 18b0a1effde69b38329fa8ba5523fecd11b47ca9 Mon Sep 17 00:00:00 2001 From: Filippo Mariotti Date: Wed, 12 Aug 2020 11:14:35 +0100 Subject: [PATCH] Remove redundant parentheses --- .../cats/tests/NonEmptyStreamSuite.scala | 14 ++++---- .../cats/tests/NonEmptyLazyListSuite.scala | 16 ++++----- .../cats/tests/ScalaVersionSpecific.scala | 6 ++-- .../scala/cats/tests/AlternativeSuite.scala | 6 ++-- .../test/scala/cats/tests/BitSetSuite.scala | 4 +-- .../cats/tests/BoundedEnumerableSuite.scala | 4 +-- .../test/scala/cats/tests/ChainSuite.scala | 20 +++++------ .../test/scala/cats/tests/ConstSuite.scala | 4 +-- .../test/scala/cats/tests/ContTSuite.scala | 4 +-- .../test/scala/cats/tests/DurationSuite.scala | 8 ++--- .../test/scala/cats/tests/EitherKSuite.scala | 2 +- .../test/scala/cats/tests/EitherSuite.scala | 32 ++++++++--------- .../test/scala/cats/tests/EitherTSuite.scala | 24 ++++++------- .../src/test/scala/cats/tests/EvalSuite.scala | 12 +++---- .../cats/tests/FiniteDurationSuite.scala | 4 +-- .../test/scala/cats/tests/FoldableSuite.scala | 32 ++++++++--------- .../scala/cats/tests/FunctionKSuite.scala | 6 ++-- .../test/scala/cats/tests/FunctorSuite.scala | 4 +-- .../test/scala/cats/tests/GroupSuite.scala | 8 ++--- .../IndexedReaderWriterStateTSuite.scala | 18 +++++----- .../scala/cats/tests/IndexedStateTSuite.scala | 14 ++++---- .../test/scala/cats/tests/InjectKSuite.scala | 6 ++-- .../test/scala/cats/tests/InjectSuite.scala | 6 ++-- .../src/test/scala/cats/tests/IorSuite.scala | 12 +++---- .../src/test/scala/cats/tests/IorTSuite.scala | 6 ++-- .../src/test/scala/cats/tests/ListSuite.scala | 6 ++-- .../src/test/scala/cats/tests/MapSuite.scala | 4 +-- .../scala/cats/tests/MonadErrorSuite.scala | 24 ++++++------- .../test/scala/cats/tests/MonadSuite.scala | 12 +++---- .../test/scala/cats/tests/MonoidSuite.scala | 6 ++-- .../scala/cats/tests/NonEmptyChainSuite.scala | 14 ++++---- .../scala/cats/tests/NonEmptyListSuite.scala | 16 ++++----- .../scala/cats/tests/NonEmptyMapSuite.scala | 18 +++++----- .../scala/cats/tests/NonEmptySetSuite.scala | 12 +++---- .../cats/tests/NonEmptyVectorSuite.scala | 36 +++++++++---------- .../test/scala/cats/tests/OptionSuite.scala | 8 ++--- .../test/scala/cats/tests/OptionTSuite.scala | 2 +- .../test/scala/cats/tests/ParallelSuite.scala | 18 +++++----- .../test/scala/cats/tests/QueueSuite.scala | 4 +-- .../scala/cats/tests/ReducibleSuite.scala | 12 +++---- .../scala/cats/tests/RegressionSuite.scala | 12 +++---- .../src/test/scala/cats/tests/SetSuite.scala | 6 ++-- .../scala/cats/tests/SortedSetSuite.scala | 2 +- .../src/test/scala/cats/tests/TrySuite.scala | 4 +-- .../test/scala/cats/tests/Tuple2KSuite.scala | 2 +- .../test/scala/cats/tests/TupleSuite.scala | 6 ++-- .../scala/cats/tests/ValidatedSuite.scala | 26 +++++++------- .../test/scala/cats/tests/VectorSuite.scala | 4 +-- .../scala/cats/tests/WordCountSuite.scala | 6 ++-- .../test/scala/cats/tests/WriterTSuite.scala | 16 ++++----- 50 files changed, 274 insertions(+), 274 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 6a25ffd1ba..12936076fe 100644 --- a/tests/src/test/scala-2.12/cats/tests/NonEmptyStreamSuite.scala +++ b/tests/src/test/scala-2.12/cats/tests/NonEmptyStreamSuite.scala @@ -54,10 +54,10 @@ class NonEmptyStreamSuite extends CatsSuite { test("Show is not empty and is formatted as expected") { forAll { (nel: NonEmptyStream[Int]) => - assert(nel.show.nonEmpty === (true)) - assert(nel.show.startsWith("OneAnd(") === (true)) + assert(nel.show.nonEmpty === true) + assert(nel.show.startsWith("OneAnd(") === true) assert(nel.show === (implicitly[Show[NonEmptyStream[Int]]].show(nel))) - assert(nel.show.contains(nel.head.show) === (true)) + assert(nel.show.contains(nel.head.show) === true) } } @@ -110,7 +110,7 @@ class NonEmptyStreamSuite extends CatsSuite { val ior = Reducible[NonEmptyStream].nonEmptyPartition(sortedNes)(identity) assert(ior.left.forall(xs => xs.sorted === xs)) - assert(ior.right.map(xs => xs.sorted === (xs)).getOrElse(true)) + assert(ior.right.map(xs => xs.sorted === xs).getOrElse(true)) } } @@ -125,7 +125,7 @@ class NonEmptyStreamSuite extends CatsSuite { val got = nel.reduceRight(f).value val last :: rev = nel.unwrap.toList.reverse val expected = rev.reverse.foldRight(last)((a, b) => f(a, Now(b)).value) - assert(got === (expected)) + assert(got === expected) } } @@ -146,7 +146,7 @@ class NonEmptyStreamSuite extends CatsSuite { val expected = nel.tail.foldLeft(Option(f(nel.head))) { (opt, i) => opt.map(s => g(s, i)) } - assert(nel.reduceLeftToOption(f)(g) === (expected)) + assert(nel.reduceLeftToOption(f)(g) === expected) } } @@ -157,7 +157,7 @@ class NonEmptyStreamSuite extends CatsSuite { val expected = rev.reverse.foldRight(Option(f(last))) { (i, opt) => opt.map(s => g(i, Now(s)).value) } - assert(got === (expected)) + assert(got === expected) } } 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 08bdffe753..9c0459f4c7 100644 --- a/tests/src/test/scala-2.13+/cats/tests/NonEmptyLazyListSuite.scala +++ b/tests/src/test/scala-2.13+/cats/tests/NonEmptyLazyListSuite.scala @@ -51,7 +51,7 @@ class NonEmptyLazyListSuite extends NonEmptyCollectionSuite[LazyList, NonEmptyLa checkAll("NonEmptyLazyList[Int]", ShortCircuitingTests[NonEmptyLazyList].nonEmptyTraverse[Int]) test("show") { - assert(Show[NonEmptyLazyList[Int]].show(NonEmptyLazyList(1, 2, 3)) === ("NonEmptyLazyList(1, ?)")) + assert(Show[NonEmptyLazyList[Int]].show(NonEmptyLazyList(1, 2, 3)) === "NonEmptyLazyList(1, ?)") } checkAll("Show[NonEmptyLazyList[Int]]", SerializableTests.serializable(Show[NonEmptyLazyList[Int]])) @@ -79,13 +79,13 @@ class NonEmptyLazyListSuite extends NonEmptyCollectionSuite[LazyList, NonEmptyLa test("filterNot and then exists should always be false") { forAll { (ci: NonEmptyLazyList[Int], f: Int => Boolean) => - assert(ci.filterNot(f).exists(f) === (false)) + assert(ci.filterNot(f).exists(f) === false) } } test("filter and then forall should always be true") { forAll { (ci: NonEmptyLazyList[Int], f: Int => Boolean) => - assert(ci.filter(f).forall(f) === (true)) + assert(ci.filter(f).forall(f) === true) } } @@ -97,19 +97,19 @@ class NonEmptyLazyListSuite extends NonEmptyCollectionSuite[LazyList, NonEmptyLa test("filterNot element and then contains should be false") { forAll { (ci: NonEmptyLazyList[Int], i: Int) => - assert(ci.filterNot(_ === i).contains(i) === (false)) + assert(ci.filterNot(_ === i).contains(i) === false) } } test("fromNonEmptyVector . toNonEmptyVector is id") { forAll { (ci: NonEmptyLazyList[Int]) => - assert(NonEmptyLazyList.fromNonEmptyVector(ci.toNonEmptyVector) === (ci)) + assert(NonEmptyLazyList.fromNonEmptyVector(ci.toNonEmptyVector) === ci) } } test("fromNonEmptyList . toNonEmptyList is id") { forAll { (ci: NonEmptyLazyList[Int]) => - assert(NonEmptyLazyList.fromNonEmptyList(ci.toNonEmptyList) === (ci)) + assert(NonEmptyLazyList.fromNonEmptyList(ci.toNonEmptyList) === ci) } } @@ -120,7 +120,7 @@ class NonEmptyLazyListSuite extends NonEmptyCollectionSuite[LazyList, NonEmptyLa } test("fromLazyListUnsafe throws exception when used with empty LazyList") { - assert(Either.catchNonFatal(NonEmptyLazyList.fromLazyListUnsafe(LazyList.empty[Int])).isLeft === (true)) + assert(Either.catchNonFatal(NonEmptyLazyList.fromLazyListUnsafe(LazyList.empty[Int])).isLeft === true) } test("fromLazyListAppend is consistent with LazyList#:+") { @@ -143,7 +143,7 @@ class NonEmptyLazyListSuite extends NonEmptyCollectionSuite[LazyList, NonEmptyLa test("reverse . reverse is id") { forAll { (ci: NonEmptyLazyList[Int]) => - assert(ci.reverse.reverse === (ci)) + assert(ci.reverse.reverse === ci) } } diff --git a/tests/src/test/scala-2.13+/cats/tests/ScalaVersionSpecific.scala b/tests/src/test/scala-2.13+/cats/tests/ScalaVersionSpecific.scala index 10c107aa7f..73060e87cf 100644 --- a/tests/src/test/scala-2.13+/cats/tests/ScalaVersionSpecific.scala +++ b/tests/src/test/scala-2.13+/cats/tests/ScalaVersionSpecific.scala @@ -50,7 +50,7 @@ trait ScalaVersionSpecificFoldableSuite { self: FoldableSuiteAdditional => } test("Foldable[LazyList] laziness of foldM") { - assert(dangerous.foldM(0)((acc, a) => if (a < 2) Some(acc + a) else None) === (None)) + assert(dangerous.foldM(0)((acc, a) => if (a < 2) Some(acc + a) else None) === None) } def foldableLazyListWithDefaultImpl: Foldable[LazyList] = @@ -112,7 +112,7 @@ trait ScalaVersionSpecificParallelSuite { self: ParallelSuite => case (a, b) => a + b } - assert((as, bs, cs).parMapN(_ + _ + _) === (zipped)) + assert((as, bs, cs).parMapN(_ + _ + _) === zipped) } } @@ -143,7 +143,7 @@ trait ScalaVersionSpecificRegressionSuite { self: RegressionSuite => } def checkAndResetCount(expected: Int): Unit = { - assert(count === (expected)) + assert(count === expected) count = 0 } diff --git a/tests/src/test/scala/cats/tests/AlternativeSuite.scala b/tests/src/test/scala/cats/tests/AlternativeSuite.scala index ca4b0e63c1..96a569691b 100644 --- a/tests/src/test/scala/cats/tests/AlternativeSuite.scala +++ b/tests/src/test/scala/cats/tests/AlternativeSuite.scala @@ -9,7 +9,7 @@ class AlternativeSuite extends CatsSuite { forAll { (list: List[Option[String]]) => val expected = list.collect { case Some(s) => s } - assert(Alternative[List].unite(list) === (expected)) + assert(Alternative[List].unite(list) === expected) } } @@ -19,7 +19,7 @@ class AlternativeSuite extends CatsSuite { val strings = list.collect { case Right(s) => s } val expected = (ints, strings) - assert(Alternative[List].separate(list) === (expected)) + assert(Alternative[List].separate(list) === expected) } } @@ -29,7 +29,7 @@ class AlternativeSuite extends CatsSuite { val strings = list.collect { case Right(s) => s } val expected = (ints, strings) - assert(Alternative[List].separateFoldable(list) === (expected)) + assert(Alternative[List].separateFoldable(list) === expected) } } diff --git a/tests/src/test/scala/cats/tests/BitSetSuite.scala b/tests/src/test/scala/cats/tests/BitSetSuite.scala index 8d30ebd82f..48caeb483b 100644 --- a/tests/src/test/scala/cats/tests/BitSetSuite.scala +++ b/tests/src/test/scala/cats/tests/BitSetSuite.scala @@ -12,8 +12,8 @@ class BitSetSuite extends CatsSuite { Arbitrary(arbitrary[List[Short]].map(ns => BitSet(ns.map(_ & 0xffff): _*))) test("show BitSet") { - assert(BitSet(1, 1, 2, 3).show === ("BitSet(1, 2, 3)")) - assert(BitSet.empty.show === ("BitSet()")) + assert(BitSet(1, 1, 2, 3).show === "BitSet(1, 2, 3)") + assert(BitSet.empty.show === "BitSet()") forAll { (fs: BitSet) => assert(fs.show === (fs.toString)) diff --git a/tests/src/test/scala/cats/tests/BoundedEnumerableSuite.scala b/tests/src/test/scala/cats/tests/BoundedEnumerableSuite.scala index 7ad15f819f..2f570a15d5 100644 --- a/tests/src/test/scala/cats/tests/BoundedEnumerableSuite.scala +++ b/tests/src/test/scala/cats/tests/BoundedEnumerableSuite.scala @@ -14,11 +14,11 @@ class BoundedEnumerableSuite extends CatsSuite { } test("cycleNext") { - assert(BoundedEnumerable[Boolean].cycleNext(false) === (true)) + assert(BoundedEnumerable[Boolean].cycleNext(false) === true) } test("cyclePrevious") { - assert(BoundedEnumerable[Boolean].cyclePrevious(false) === (true)) + assert(BoundedEnumerable[Boolean].cyclePrevious(false) === true) } } diff --git a/tests/src/test/scala/cats/tests/ChainSuite.scala b/tests/src/test/scala/cats/tests/ChainSuite.scala index 678c944bc3..7946aff586 100644 --- a/tests/src/test/scala/cats/tests/ChainSuite.scala +++ b/tests/src/test/scala/cats/tests/ChainSuite.scala @@ -71,8 +71,8 @@ class ChainSuite extends CatsSuite { } test("show") { - assert(Show[Chain[Int]].show(Chain(1, 2, 3)) === ("Chain(1, 2, 3)")) - assert(Chain.empty[Int].show === ("Chain()")) + assert(Show[Chain[Int]].show(Chain(1, 2, 3)) === "Chain(1, 2, 3)") + assert(Chain.empty[Int].show === "Chain()") forAll { (l: Chain[String]) => assert(l.show === (l.toString)) } @@ -113,13 +113,13 @@ class ChainSuite extends CatsSuite { test("filterNot and then exists should always be false") { forAll { (ci: Chain[Int], f: Int => Boolean) => - assert(ci.filterNot(f).exists(f) === (false)) + assert(ci.filterNot(f).exists(f) === false) } } test("filter and then forall should always be true") { forAll { (ci: Chain[Int], f: Int => Boolean) => - assert(ci.filter(f).forall(f) === (true)) + assert(ci.filter(f).forall(f) === true) } } @@ -137,25 +137,25 @@ class ChainSuite extends CatsSuite { test("filterNot element and then contains should be false") { forAll { (ci: Chain[Int], i: Int) => - assert(ci.filterNot(_ === i).contains(i) === (false)) + assert(ci.filterNot(_ === i).contains(i) === false) } } test("Always nonempty after cons") { forAll { (ci: Chain[Int], i: Int) => - assert((i +: ci).nonEmpty === (true)) + assert((i +: ci).nonEmpty === true) } } test("fromSeq . toVector is id") { forAll { (ci: Chain[Int]) => - assert(Chain.fromSeq(ci.toVector) === (ci)) + assert(Chain.fromSeq(ci.toVector) === ci) } } test("fromSeq . toList . iterator is id") { forAll { (ci: Chain[Int]) => - assert(Chain.fromSeq(ci.iterator.toList) === (ci)) + assert(Chain.fromSeq(ci.iterator.toList) === ci) } } @@ -191,7 +191,7 @@ class ChainSuite extends CatsSuite { test("reverse . reverse is id") { forAll { (ci: Chain[Int]) => - assert(ci.reverse.reverse === (ci)) + assert(ci.reverse.reverse === ci) } } @@ -259,7 +259,7 @@ class ChainSuite extends CatsSuite { test("== returns false for non-Chains") { forAll { (a: Chain[Int], b: Int) => - assert((a == b) === (false)) + assert((a == b) === false) } } diff --git a/tests/src/test/scala/cats/tests/ConstSuite.scala b/tests/src/test/scala/cats/tests/ConstSuite.scala index 45bd788259..2e45d1095f 100644 --- a/tests/src/test/scala/cats/tests/ConstSuite.scala +++ b/tests/src/test/scala/cats/tests/ConstSuite.scala @@ -94,10 +94,10 @@ class ConstSuite extends CatsSuite { test("show") { - assert(Const(1).show === ("Const(1)")) + assert(Const(1).show === "Const(1)") forAll { (const: Const[Int, String]) => - assert(const.show.startsWith("Const(") === (true)) + assert(const.show.startsWith("Const(") === true) const.show.contains(const.getConst.show) assert(const.show === (implicitly[Show[Const[Int, String]]].show(const))) assert(const.show === (const.retag[Boolean].show)) diff --git a/tests/src/test/scala/cats/tests/ContTSuite.scala b/tests/src/test/scala/cats/tests/ContTSuite.scala index 639e390ea9..873648ddfb 100644 --- a/tests/src/test/scala/cats/tests/ContTSuite.scala +++ b/tests/src/test/scala/cats/tests/ContTSuite.scala @@ -79,10 +79,10 @@ class ContTSuite extends CatsSuite { didSideEffect = true b } - assert(didSideEffect === (false)) + assert(didSideEffect === false) contT.run(cb) - assert(didSideEffect === (true)) + assert(didSideEffect === true) } } diff --git a/tests/src/test/scala/cats/tests/DurationSuite.scala b/tests/src/test/scala/cats/tests/DurationSuite.scala index b391f00bf1..a967476bdf 100644 --- a/tests/src/test/scala/cats/tests/DurationSuite.scala +++ b/tests/src/test/scala/cats/tests/DurationSuite.scala @@ -9,12 +9,12 @@ class DurationSuite extends CatsSuite { checkAll("Show[Duration]", SerializableTests.serializable(Show[Duration])) test("show works for FiniteDuration") { - assert(Show[Duration].show(23.minutes) === ("23 minutes")) + assert(Show[Duration].show(23.minutes) === "23 minutes") } test("show works for non-finite durations") { - assert(Show[Duration].show(Duration.Inf) === ("Duration.Inf")) - assert(Show[Duration].show(Duration.MinusInf) === ("Duration.MinusInf")) - assert(Show[Duration].show(Duration.Undefined) === ("Duration.Undefined")) + assert(Show[Duration].show(Duration.Inf) === "Duration.Inf") + assert(Show[Duration].show(Duration.MinusInf) === "Duration.MinusInf") + assert(Show[Duration].show(Duration.Undefined) === "Duration.Undefined") } } diff --git a/tests/src/test/scala/cats/tests/EitherKSuite.scala b/tests/src/test/scala/cats/tests/EitherKSuite.scala index 7e9b0259c7..855da4daf2 100644 --- a/tests/src/test/scala/cats/tests/EitherKSuite.scala +++ b/tests/src/test/scala/cats/tests/EitherKSuite.scala @@ -43,7 +43,7 @@ class EitherKSuite extends CatsSuite { test("double swap is identity") { forAll { (x: EitherK[Option, Option, Int]) => - assert(x.swap.swap === (x)) + assert(x.swap.swap === x) } } diff --git a/tests/src/test/scala/cats/tests/EitherSuite.scala b/tests/src/test/scala/cats/tests/EitherSuite.scala index 10990724c3..82e783e883 100644 --- a/tests/src/test/scala/cats/tests/EitherSuite.scala +++ b/tests/src/test/scala/cats/tests/EitherSuite.scala @@ -92,14 +92,14 @@ class EitherSuite extends CatsSuite { test("show isn't empty") { forAll { (e: Either[Int, String]) => - assert(show.show(e).nonEmpty === (true)) + assert(show.show(e).nonEmpty === true) } } test("map2Eval is lazy") { val bomb: Eval[Either[String, Int]] = Later(sys.error("boom")) val x: Either[String, Int] = Left("l") - assert(x.map2Eval(bomb)(_ + _).value === (x)) + assert(x.map2Eval(bomb)(_ + _).value === x) } test("catchOnly lets non-matching exceptions escape") { @@ -139,7 +139,7 @@ class EitherSuite extends CatsSuite { test("double swap is identity") { forAll { (x: Either[Int, String]) => - assert(x.swap.swap === (x)) + assert(x.swap.swap === x) } } @@ -199,38 +199,38 @@ class EitherSuite extends CatsSuite { test("orElse") { forAll { (x: Either[Int, String], y: Either[Int, String]) => val z = x.orElse(y) - assert((z === (x)) || (z === (y)) === (true)) + assert((z === x) || (z === y) === true) } } test("recover recovers handled values") { val either = Either.left[String, Int]("either") - assert(either.recover { case "either" => 5 }.isRight === (true)) + assert(either.recover { case "either" => 5 }.isRight === true) } test("recover ignores unhandled values") { val either = Either.left[String, Int]("either") - assert(either.recover { case "noteither" => 5 } === (either)) + assert(either.recover { case "noteither" => 5 } === either) } test("recover ignores the right side") { val either = Either.right[String, Int](10) - assert(either.recover { case "either" => 5 } === (either)) + assert(either.recover { case "either" => 5 } === either) } test("recoverWith recovers handled values") { val either = Either.left[String, Int]("either") - assert(either.recoverWith { case "either" => Either.right[String, Int](5) }.isRight === (true)) + assert(either.recoverWith { case "either" => Either.right[String, Int](5) }.isRight === true) } test("recoverWith ignores unhandled values") { val either = Either.left[String, Int]("either") - assert(either.recoverWith { case "noteither" => Either.right[String, Int](5) } === (either)) + assert(either.recoverWith { case "noteither" => Either.right[String, Int](5) } === either) } test("recoverWith ignores the right side") { val either = Either.right[String, Int](10) - assert(either.recoverWith { case "either" => Either.right[String, Int](5) } === (either)) + assert(either.recoverWith { case "either" => Either.right[String, Int](5) } === either) } test("valueOr consistent with swap then map then merge") { @@ -242,7 +242,7 @@ class EitherSuite extends CatsSuite { test("isLeft implies forall") { forAll { (x: Either[Int, String], p: String => Boolean) => if (x.isLeft) { - assert(x.forall(p) === (true)) + assert(x.forall(p) === true) } } } @@ -250,14 +250,14 @@ class EitherSuite extends CatsSuite { test("isLeft implies exists is false") { forAll { (x: Either[Int, String], p: String => Boolean) => if (x.isLeft) { - assert(x.exists(p) === (false)) + assert(x.exists(p) === false) } } } test("toIor then toEither is identity") { forAll { (x: Either[Int, String]) => - assert(x.toIor.toEither === (x)) + assert(x.toIor.toEither === x) } } @@ -265,7 +265,7 @@ class EitherSuite extends CatsSuite { implicit def eqTh: Eq[Throwable] = Eq.allEqual forAll { (x: Throwable Either String) => - assert(Either.fromTry(x.toTry) === (x)) + assert(Either.fromTry(x.toTry) === x) } } @@ -330,12 +330,12 @@ class EitherSuite extends CatsSuite { test("show Right") { val either = Either.right[String, Int](10) - assert(either.show === ("Right(10)")) + assert(either.show === "Right(10)") } test("show Left") { val either = Either.left[String, Int]("string") - assert(either.show === ("Left(string)")) + assert(either.show === "Left(string)") } test("toEitherNel Left") { diff --git a/tests/src/test/scala/cats/tests/EitherTSuite.scala b/tests/src/test/scala/cats/tests/EitherTSuite.scala index 7c2e0370a2..515a1f3eff 100644 --- a/tests/src/test/scala/cats/tests/EitherTSuite.scala +++ b/tests/src/test/scala/cats/tests/EitherTSuite.scala @@ -265,7 +265,7 @@ class EitherTSuite extends CatsSuite { test("double swap is noop") { forAll { (eithert: EitherT[List, String, Int]) => - assert(eithert.swap.swap === (eithert)) + assert(eithert.swap.swap === eithert) } } @@ -289,41 +289,41 @@ class EitherTSuite extends CatsSuite { test("recover recovers handled values") { val eithert = EitherT.leftT[Id, Int]("eithert") - assert(eithert.recover { case "eithert" => 5 }.isRight === (true)) + assert(eithert.recover { case "eithert" => 5 }.isRight === true) } test("recover ignores unhandled values") { val eithert = EitherT.leftT[Id, Int]("eithert") - assert(eithert.recover { case "noteithert" => 5 } === (eithert)) + assert(eithert.recover { case "noteithert" => 5 } === eithert) } test("recover ignores the right side") { val eithert = EitherT.pure[Id, String](10) - assert(eithert.recover { case "eithert" => 5 } === (eithert)) + assert(eithert.recover { case "eithert" => 5 } === eithert) } test("recoverWith recovers handled values") { val eithert = EitherT.leftT[Id, Int]("eithert") - assert(eithert.recoverWith { case "eithert" => EitherT.pure[Id, String](5) }.isRight === (true)) + assert(eithert.recoverWith { case "eithert" => EitherT.pure[Id, String](5) }.isRight === true) } test("recoverWith ignores unhandled values") { val eithert = EitherT.leftT[Id, Int]("eithert") - assert(eithert.recoverWith { case "noteithert" => EitherT.pure[Id, String](5) } === (eithert)) + assert(eithert.recoverWith { case "noteithert" => EitherT.pure[Id, String](5) } === eithert) } test("rethrowT is inverse of attemptT when applied to a successful value") { implicit val eqThrow: Eq[Throwable] = Eq.fromUniversalEquals val success: Try[Int] = Success(42) - assert(success.attemptT.rethrowT === (success)) + assert(success.attemptT.rethrowT === success) } test("rethrowT is inverse of attemptT when applied to a failed value") { implicit val eqThrow: Eq[Throwable] = Eq.fromUniversalEquals val failed: Try[Int] = Failure(new IllegalArgumentException("error")) - assert(failed.attemptT.rethrowT === (failed)) + assert(failed.attemptT.rethrowT === failed) } test("rethrowT works with specialized failures") { @@ -332,7 +332,7 @@ class EitherTSuite extends CatsSuite { val t: EitherT[Try, IllegalArgumentException, Int] = failed.attemptT.leftMap(_.asInstanceOf[IllegalArgumentException]) - assert(t.rethrowT === (failed)) + assert(t.rethrowT === failed) } test("transform consistent with value.map") { @@ -416,7 +416,7 @@ class EitherTSuite extends CatsSuite { var evals = 0 val eithert = EitherT(Eval.always { evals += 1; either }).orElse(fallback) eithert.value.value - assert(evals === (1)) + assert(evals === 1) } } @@ -502,7 +502,7 @@ class EitherTSuite extends CatsSuite { test("ensure on left is identity") { forAll { (x: EitherT[Id, String, Int], s: String, p: Int => Boolean) => if (x.isLeft) { - assert(x.ensure(s)(p) === (x)) + assert(x.ensure(s)(p) === x) } } } @@ -510,7 +510,7 @@ class EitherTSuite extends CatsSuite { test("ensure on right is identity if predicate satisfied") { forAll { (x: EitherT[Id, String, Int], s: String, p: Int => Boolean) => if (x.isRight && p(x.getOrElse(0))) { - assert(x.ensure(s)(p) === (x)) + assert(x.ensure(s)(p) === x) } } } diff --git a/tests/src/test/scala/cats/tests/EvalSuite.scala b/tests/src/test/scala/cats/tests/EvalSuite.scala index 5cdb93ed06..a30c0d1779 100644 --- a/tests/src/test/scala/cats/tests/EvalSuite.scala +++ b/tests/src/test/scala/cats/tests/EvalSuite.scala @@ -45,10 +45,10 @@ class EvalSuite extends CatsSuite { val (spooky, lz) = init(value) (0 until n).foreach { _ => val result = lz.value - assert(result === (value)) + assert(result === value) spin ^= result.## } - assert(spooky.counter === (numEvals)) + assert(spooky.counter === numEvals) () } (0 to 2).foreach(n => nTimes(n, numCalls(n))) @@ -89,13 +89,13 @@ class EvalSuite extends CatsSuite { val i2 = Eval.always(spooky.increment()).memoize val i3 = Eval.now(()).flatMap(_ => Eval.later(spooky.increment())).memoize i2.value - assert(spooky.counter === (1)) + assert(spooky.counter === 1) i2.value - assert(spooky.counter === (1)) + assert(spooky.counter === 1) i3.value - assert(spooky.counter === (2)) + assert(spooky.counter === 2) i3.value - assert(spooky.counter === (2)) + assert(spooky.counter === 2) } test("Defer and FlatMap compose without blowing the stack") { diff --git a/tests/src/test/scala/cats/tests/FiniteDurationSuite.scala b/tests/src/test/scala/cats/tests/FiniteDurationSuite.scala index 9f4f164812..584f04263a 100644 --- a/tests/src/test/scala/cats/tests/FiniteDurationSuite.scala +++ b/tests/src/test/scala/cats/tests/FiniteDurationSuite.scala @@ -9,7 +9,7 @@ class FiniteDurationSuite extends CatsSuite { checkAll("Show[FiniteDuration]", SerializableTests.serializable(Show[FiniteDuration])) test("show works for FiniteDuration") { - assert(Show[FiniteDuration].show(23.minutes) === ("23 minutes")) - assert(Show[FiniteDuration].show(10.seconds) === ("10 seconds")) + assert(Show[FiniteDuration].show(23.minutes) === "23 minutes") + assert(Show[FiniteDuration].show(10.seconds) === "10 seconds") } } diff --git a/tests/src/test/scala/cats/tests/FoldableSuite.scala b/tests/src/test/scala/cats/tests/FoldableSuite.scala index 77ee1180f3..d1c7a7de0d 100644 --- a/tests/src/test/scala/cats/tests/FoldableSuite.scala +++ b/tests/src/test/scala/cats/tests/FoldableSuite.scala @@ -58,8 +58,8 @@ abstract class FoldableSuite[F[_]: Foldable](name: String)(implicit case Right(_) => false }) - assert(lefts.map(_.asLeft[String]) === (ls)) - assert(rights.map(_.asRight[String]) === (rs)) + assert(lefts.map(_.asLeft[String]) === ls) + assert(rights.map(_.asRight[String]) === rs) } } @@ -84,8 +84,8 @@ abstract class FoldableSuite[F[_]: Foldable](name: String)(implicit val sorted = list.map(f).sorted val (lefts, rights) = Foldable[List].partitionEither(sorted)(identity) - assert(lefts.sorted === (lefts)) - assert(rights.sorted === (rights)) + assert(lefts.sorted === lefts) + assert(rights.sorted === rights) } } @@ -145,10 +145,10 @@ abstract class FoldableSuite[F[_]: Foldable](name: String)(implicit test(s"Foldable[$name] summation") { forAll { (fa: F[Int]) => val total = iterator(fa).sum - assert(fa.foldLeft(0)(_ + _) === (total)) - assert(fa.foldRight(Now(0))((x, ly) => ly.map(x + _)).value === (total)) - assert(fa.fold === (total)) - assert(fa.foldMap(identity) === (total)) + assert(fa.foldLeft(0)(_ + _) === total) + assert(fa.foldRight(Now(0))((x, ly) => ly.map(x + _)).value === total) + assert(fa.fold === total) + assert(fa.foldMap(identity) === total) } } @@ -205,8 +205,8 @@ abstract class FoldableSuite[F[_]: Foldable](name: String)(implicit assert(maxOpt === (nelOpt.map(_.toList.max))) assert(minOpt === (nelOpt.map(_.minimum))) assert(minOpt === (nelOpt.map(_.toList.min))) - assert(maxOpt.forall(i => fa.forall(_ <= i)) === (true)) - assert(minOpt.forall(i => fa.forall(_ >= i)) === (true)) + assert(maxOpt.forall(i => fa.forall(_ <= i)) === true) + assert(minOpt.forall(i => fa.forall(_ >= i)) === true) } } @@ -219,8 +219,8 @@ abstract class FoldableSuite[F[_]: Foldable](name: String)(implicit assert(maxOpt === (nelOpt.map(_.toList.maxBy(f)).map(f))) assert(minOpt === (nelOpt.map(_.minimumBy(f)).map(f))) assert(minOpt === (nelOpt.map(_.toList.minBy(f)).map(f))) - assert(maxOpt.forall(i => fa.forall(f(_) <= i)) === (true)) - assert(minOpt.forall(i => fa.forall(f(_) >= i)) === (true)) + assert(maxOpt.forall(i => fa.forall(f(_) <= i)) === true) + assert(minOpt.forall(i => fa.forall(f(_) >= i)) === true) } } @@ -298,9 +298,9 @@ class FoldableSuiteAdditional extends CatsSuite with ScalaVersionSpecificFoldabl // some basic sanity checks val ns = (1 to 10).toList val total = ns.sum - assert(F.foldLeft(ns, 0)(_ + _) === (total)) - assert(F.foldRight(ns, Now(0))((x, ly) => ly.map(x + _)).value === (total)) - assert(F.fold(ns) === (total)) + assert(F.foldLeft(ns, 0)(_ + _) === total) + assert(F.foldRight(ns, Now(0))((x, ly) => ly.map(x + _)).value === total) + assert(F.fold(ns) === total) // more basic checks val names = List("Aaron", "Betty", "Calvin", "Deirdra") @@ -464,7 +464,7 @@ class FoldableSuiteAdditional extends CatsSuite with ScalaVersionSpecificFoldabl } test("Foldable[Stream] laziness of foldM") { - assert(dangerous.foldM(0)((acc, a) => if (a < 2) Some(acc + a) else None) === (None)) + assert(dangerous.foldM(0)((acc, a) => if (a < 2) Some(acc + a) else None) === None) } def foldableStreamWithDefaultImpl: Foldable[Stream] = diff --git a/tests/src/test/scala/cats/tests/FunctionKSuite.scala b/tests/src/test/scala/cats/tests/FunctionKSuite.scala index f7ac975c46..5297e30862 100644 --- a/tests/src/test/scala/cats/tests/FunctionKSuite.scala +++ b/tests/src/test/scala/cats/tests/FunctionKSuite.scala @@ -45,15 +45,15 @@ class FunctionKSuite extends CatsSuite { test("id is identity") { forAll { (list: List[Int]) => - assert(FunctionK.id[List].apply(list) === (list)) + assert(FunctionK.id[List].apply(list) === list) } } test("or") { val combinedInterpreter = Test1FK.or(Test2FK) forAll { (a: Int, b: Int) => - assert(combinedInterpreter(EitherK.left(Test1(a))) === (a)) - assert(combinedInterpreter(EitherK.right(Test2(b))) === (b)) + assert(combinedInterpreter(EitherK.left(Test1(a))) === a) + assert(combinedInterpreter(EitherK.right(Test2(b))) === b) } } diff --git a/tests/src/test/scala/cats/tests/FunctorSuite.scala b/tests/src/test/scala/cats/tests/FunctorSuite.scala index 4fc9706a7b..b80c91f5b3 100644 --- a/tests/src/test/scala/cats/tests/FunctorSuite.scala +++ b/tests/src/test/scala/cats/tests/FunctorSuite.scala @@ -59,10 +59,10 @@ class FunctorSuite extends CatsSuite { test("ifF equals map(if(_) ifTrue else ifFalse) for concrete lists and options") { assert(Functor[List].ifF(List(true, false, false, true))(1, 0) === (List(1, 0, 0, 1))) - assert(Functor[List].ifF(List.empty[Boolean])(1, 0) === (Nil)) + assert(Functor[List].ifF(List.empty[Boolean])(1, 0) === Nil) assert(Functor[Option].ifF(Some(true))(1, 0) === (Some(1))) assert(Functor[Option].ifF(Some(false))(1, 0) === (Some(0))) - assert(Functor[Option].ifF(None)(1, 0) === (None)) + assert(Functor[Option].ifF(None)(1, 0) === None) } diff --git a/tests/src/test/scala/cats/tests/GroupSuite.scala b/tests/src/test/scala/cats/tests/GroupSuite.scala index 94720d93f9..782f025f01 100644 --- a/tests/src/test/scala/cats/tests/GroupSuite.scala +++ b/tests/src/test/scala/cats/tests/GroupSuite.scala @@ -10,13 +10,13 @@ class GroupSuite extends CatsSuite { } test("combine negative") { - assert(Group[Int].combineN(1, -1) === (-1)) - assert(Group[Int].combineN(1, -10) === (-10)) + assert(Group[Int].combineN(1, -1) === -1) + assert(Group[Int].combineN(1, -10) === -10) } test("companion object syntax") { - assert(Group[Int].inverse(1) === (-1)) - assert(Group[Int].remove(1, 2) === (-1)) + assert(Group[Int].inverse(1) === -1) + assert(Group[Int].remove(1, 2) === -1) } checkAll("Int", GroupTests[Int].group) diff --git a/tests/src/test/scala/cats/tests/IndexedReaderWriterStateTSuite.scala b/tests/src/test/scala/cats/tests/IndexedReaderWriterStateTSuite.scala index 88a2a15d33..ccb02369f8 100644 --- a/tests/src/test/scala/cats/tests/IndexedReaderWriterStateTSuite.scala +++ b/tests/src/test/scala/cats/tests/IndexedReaderWriterStateTSuite.scala @@ -32,7 +32,7 @@ class ReaderWriterStateTSuite extends CatsSuite { val ns = (0 to 70000).toList val rws = ns.traverse(_ => addLogUnit(1)) - assert(rws.runS("context", 0).value === (70001)) + assert(rws.runS("context", 0).value === 70001) } test("flatMap is stack-safe on repeated left binds when F is") { @@ -40,7 +40,7 @@ class ReaderWriterStateTSuite extends CatsSuite { val one = addLogUnit(1) val rws = ns.foldLeft(one)((acc, _) => acc.flatMap(_ => one)) - assert(rws.runS("context", 0).value === (70002)) + assert(rws.runS("context", 0).value === 70002) } test("flatMap is stack-safe on repeated right binds when F is") { @@ -48,7 +48,7 @@ class ReaderWriterStateTSuite extends CatsSuite { val one = addLogUnit(1) val rws = ns.foldLeft(one)((acc, _) => one.flatMap(_ => acc)) - assert(rws.runS("context", 0).value === (70002)) + assert(rws.runS("context", 0).value === 70002) } test("map2 combines logs") { @@ -64,13 +64,13 @@ class ReaderWriterStateTSuite extends CatsSuite { val logB = rwsb.runL(c, stateA).value val combinedLog = logA |+| logB - assert(logMap2 === (combinedLog)) + assert(logMap2 === combinedLog) } } test("ReaderWriterState.ask provides the context") { forAll { (context: String, initial: Int) => - assert(ReaderWriterState.ask[String, String, Int].runA(context, initial).value === (context)) + assert(ReaderWriterState.ask[String, String, Int].runA(context, initial).value === context) } } @@ -223,7 +223,7 @@ class ReaderWriterStateTSuite extends CatsSuite { test("ReaderWriterState.tell + written is identity") { forAll { (context: String, initial: Int, log: String) => - assert(ReaderWriterState.tell[String, String, Int](log).written.runA(context, initial).value === (log)) + assert(ReaderWriterState.tell[String, String, Int](log).written.runA(context, initial).value === log) } } @@ -232,8 +232,8 @@ class ReaderWriterStateTSuite extends CatsSuite { val (log, state, result) = rws.run("context", 0).value assert(log === (Vector("context: Added 5", "context: Added 10"))) - assert(state === (15)) - assert(result === (15)) + assert(state === 15) + assert(result === 15) } test("flatMap and flatMapF+tell are consistent") { @@ -330,7 +330,7 @@ class ReaderWriterStateTSuite extends CatsSuite { forAll { (c: String, initial: Long, rws: ReaderWriterState[String, String, Long, Long]) => val (_, state, value) = rws.get.run(c, initial).value - assert(state === (value)) + assert(state === value) } } diff --git a/tests/src/test/scala/cats/tests/IndexedStateTSuite.scala b/tests/src/test/scala/cats/tests/IndexedStateTSuite.scala index 6ef2f571fc..e22ac31f62 100644 --- a/tests/src/test/scala/cats/tests/IndexedStateTSuite.scala +++ b/tests/src/test/scala/cats/tests/IndexedStateTSuite.scala @@ -46,7 +46,7 @@ class IndexedStateTSuite extends CatsSuite { test("traversing state is stack-safe") { val ns = (0 to 70000).toList val x = ns.traverse(_ => add1) - assert(x.runS(0).value === (70001)) + assert(x.runS(0).value === 70001) } test("State.pure, StateT.pure and IndexedStateT.pure are consistent") { @@ -161,7 +161,7 @@ class IndexedStateTSuite extends CatsSuite { test("Semigroupal syntax is usable on State") { val x = add1 *> add1 - assert(x.runS(0).value === (2)) + assert(x.runS(0).value === 2) } test("Singleton and instance inspect are consistent") { @@ -184,7 +184,7 @@ class IndexedStateTSuite extends CatsSuite { test("modify identity is a noop") { forAll { (f: StateT[List, MiniInt, Int]) => - assert(f.modify(identity) === (f)) + assert(f.modify(identity) === f) } } @@ -209,7 +209,7 @@ class IndexedStateTSuite extends CatsSuite { val s2 = State.modify(f) - assert(s1 === (s2)) + assert(s1 === s2) } } @@ -232,7 +232,7 @@ class IndexedStateTSuite extends CatsSuite { test(".get and then .run produces same state as value") { forAll { (s: State[Long, Int], initial: Long) => val (finalS, finalA) = s.get.run(initial).value - assert(finalS === (finalA)) + assert(finalS === finalA) } } @@ -244,7 +244,7 @@ class IndexedStateTSuite extends CatsSuite { test("StateT#transformS with identity is identity") { forAll { (s: StateT[List, MiniInt, Int]) => - assert(s.transformS[MiniInt](identity, (s, i) => i) === (s)) + assert(s.transformS[MiniInt](identity, (s, i) => i) === s) } } @@ -263,7 +263,7 @@ class IndexedStateTSuite extends CatsSuite { val got = x.run(input) val expected = xx.run(Env(input, "hello")).map { case (e, i) => (e.int, i) } - assert(got === (expected)) + assert(got === expected) } private val stackSafeTestSize = diff --git a/tests/src/test/scala/cats/tests/InjectKSuite.scala b/tests/src/test/scala/cats/tests/InjectKSuite.scala index d639696116..8b068542d2 100644 --- a/tests/src/test/scala/cats/tests/InjectKSuite.scala +++ b/tests/src/test/scala/cats/tests/InjectKSuite.scala @@ -98,19 +98,19 @@ class InjectKSuite extends CatsSuite { test("apply in left") { forAll { (y: Test1Algebra[Int]) => - assert(InjectK[Test1Algebra, T].inj(y) == EitherK(Left(y)) === (true)) + assert(InjectK[Test1Algebra, T].inj(y) == EitherK(Left(y)) === true) } } test("apply in right") { forAll { (y: Test2Algebra[Int]) => - assert(InjectK[Test2Algebra, T].inj(y) == EitherK(Right(y)) === (true)) + assert(InjectK[Test2Algebra, T].inj(y) == EitherK(Right(y)) === true) } } test("null identity") { val listIntNull = null.asInstanceOf[List[Int]] - assert(InjectK.catsReflexiveInjectKInstance[List].inj[Int](listIntNull) === (listIntNull)) + assert(InjectK.catsReflexiveInjectKInstance[List].inj[Int](listIntNull) === listIntNull) assert(InjectK.catsReflexiveInjectKInstance[List].prj[Int](listIntNull) === (Some(listIntNull))) } diff --git a/tests/src/test/scala/cats/tests/InjectSuite.scala b/tests/src/test/scala/cats/tests/InjectSuite.scala index 8bd35c018c..8362dc891c 100644 --- a/tests/src/test/scala/cats/tests/InjectSuite.scala +++ b/tests/src/test/scala/cats/tests/InjectSuite.scala @@ -41,19 +41,19 @@ class InjectSuite extends CatsSuite { test("apply in left") { forAll { (y: String) => - assert(Inject[String, StringOrInt].inj(y) == Left(y) === (true)) + assert(Inject[String, StringOrInt].inj(y) == Left(y) === true) } } test("apply in right") { forAll { (y: Int) => - assert(Inject[Int, StringOrInt].inj(y) == Right(y) === (true)) + assert(Inject[Int, StringOrInt].inj(y) == Right(y) === true) } } test("null identity") { val stringNull = null.asInstanceOf[String] - assert(Inject.catsReflexiveInjectInstance[String].inj(stringNull) === (stringNull)) + assert(Inject.catsReflexiveInjectInstance[String].inj(stringNull) === stringNull) assert(Inject.catsReflexiveInjectInstance[String].prj(stringNull) === (Some(stringNull))) } diff --git a/tests/src/test/scala/cats/tests/IorSuite.scala b/tests/src/test/scala/cats/tests/IorSuite.scala index ddbd573bca..f1a1033801 100644 --- a/tests/src/test/scala/cats/tests/IorSuite.scala +++ b/tests/src/test/scala/cats/tests/IorSuite.scala @@ -104,7 +104,7 @@ class IorSuite extends CatsSuite { test("isLeft consistent with forall and exists") { forAll { (i: Int Ior String, p: String => Boolean) => if (i.isLeft) { - assert((i.forall(p) && !i.exists(p)) === (true)) + assert((i.forall(p) && !i.exists(p)) === true) } } } @@ -138,7 +138,7 @@ class IorSuite extends CatsSuite { val iorShow = implicitly[Show[Int Ior String]] forAll { (i: Int Ior String) => - assert(iorShow.show(i).nonEmpty === (true)) + assert(iorShow.show(i).nonEmpty === true) } } @@ -167,7 +167,7 @@ class IorSuite extends CatsSuite { Ior.left(2) else Ior.both(2, i.right.get) - assert(i.putLeft(2) === (expectedResult)) + assert(i.putLeft(2) === expectedResult) } } @@ -178,7 +178,7 @@ class IorSuite extends CatsSuite { Ior.right(2) else Ior.both(i.left.get, 2) - assert(i.putRight(2) === (expectedResult)) + assert(i.putRight(2) === expectedResult) } } @@ -197,8 +197,8 @@ class IorSuite extends CatsSuite { test("fromOptions left/right consistent with input options") { forAll { (oa: Option[String], ob: Option[Int]) => val x = Ior.fromOptions(oa, ob) - assert(x.flatMap(_.left) === (oa)) - assert(x.flatMap(_.right) === (ob)) + assert(x.flatMap(_.left) === oa) + assert(x.flatMap(_.right) === ob) } } diff --git a/tests/src/test/scala/cats/tests/IorTSuite.scala b/tests/src/test/scala/cats/tests/IorTSuite.scala index 6863b532ce..af5c885188 100644 --- a/tests/src/test/scala/cats/tests/IorTSuite.scala +++ b/tests/src/test/scala/cats/tests/IorTSuite.scala @@ -337,19 +337,19 @@ class IorTSuite extends CatsSuite { test("IorT.fromIor with Id is noop") { forAll { (ior: Ior[String, Int]) => - assert(IorT.fromIor[Id](ior).value === (ior)) + assert(IorT.fromIor[Id](ior).value === ior) } } test("IorT.fromEither toEither is noop") { forAll { (either: Either[String, Int]) => - assert(IorT.fromEither[Id](either).value.toEither === (either)) + assert(IorT.fromEither[Id](either).value.toEither === either) } } test("IorT.fromEitherF toEither is noop") { forAll { (either: Either[String, Int]) => - assert(IorT.fromEitherF[Id, String, Int](either).value.toEither === (either)) + assert(IorT.fromEitherF[Id, String, Int](either).value.toEither === either) } } diff --git a/tests/src/test/scala/cats/tests/ListSuite.scala b/tests/src/test/scala/cats/tests/ListSuite.scala index 7a7ab62daa..a25afedcd3 100644 --- a/tests/src/test/scala/cats/tests/ListSuite.scala +++ b/tests/src/test/scala/cats/tests/ListSuite.scala @@ -55,7 +55,7 @@ class ListSuite extends CatsSuite { ) test("toNel on empty list returns None") { - assert(List.empty[Int].toNel === (None)) + assert(List.empty[Int].toNel === None) } test("groupByNel should be consistent with groupBy")( @@ -71,8 +71,8 @@ class ListSuite extends CatsSuite { ) test("show") { - assert(List(1, 2, 3).show === ("List(1, 2, 3)")) - assert((Nil: List[Int]).show === ("List()")) + assert(List(1, 2, 3).show === "List(1, 2, 3)") + assert((Nil: List[Int]).show === "List()") forAll { (l: List[String]) => assert(l.show === (l.toString)) } diff --git a/tests/src/test/scala/cats/tests/MapSuite.scala b/tests/src/test/scala/cats/tests/MapSuite.scala index a04e2b86b7..29b58941b4 100644 --- a/tests/src/test/scala/cats/tests/MapSuite.scala +++ b/tests/src/test/scala/cats/tests/MapSuite.scala @@ -53,8 +53,8 @@ class MapSuite extends CatsSuite { test("show isn't empty and is formatted as expected") { forAll { (map: Map[Int, String]) => - assert(map.show.nonEmpty === (true)) - assert(map.show.startsWith("Map(") === (true)) + assert(map.show.nonEmpty === true) + assert(map.show.startsWith("Map(") === true) assert(map.show === (implicitly[Show[Map[Int, String]]].show(map))) } } diff --git a/tests/src/test/scala/cats/tests/MonadErrorSuite.scala b/tests/src/test/scala/cats/tests/MonadErrorSuite.scala index dfc9cf871a..f269cdccea 100644 --- a/tests/src/test/scala/cats/tests/MonadErrorSuite.scala +++ b/tests/src/test/scala/cats/tests/MonadErrorSuite.scala @@ -16,29 +16,29 @@ class MonadErrorSuite extends CatsSuite { val failed: Try[Int] = Failure(failedValue) test("ensure raises an error if the predicate fails") { - assert(successful.ensure(failedValue)(_ => false) === (failed)) + assert(successful.ensure(failedValue)(_ => false) === failed) } test("ensure returns the successful value if the predicate succeeds") { - assert(successful.ensure(failedValue)(_ => true) === (successful)) + assert(successful.ensure(failedValue)(_ => true) === successful) } test("ensure returns the original failure, when applied to a failure") { - assert(failed.ensure(otherValue)(_ => false) === (failed)) - assert(failed.ensure(otherValue)(_ => true) === (failed)) + assert(failed.ensure(otherValue)(_ => false) === failed) + assert(failed.ensure(otherValue)(_ => true) === failed) } test("ensureOr raises an error if the predicate fails") { - assert(successful.ensureOr(_ => failedValue)(_ => false) === (failed)) + assert(successful.ensureOr(_ => failedValue)(_ => false) === failed) } test("ensureOr returns the successful value if the predicate succeeds") { - assert(successful.ensureOr(_ => failedValue)(_ => true) === (successful)) + assert(successful.ensureOr(_ => failedValue)(_ => true) === successful) } test("ensureOr returns the original failure, when applied to a failure") { - assert(failed.ensureOr(_ => otherValue)(_ => false) === (failed)) - assert(failed.ensureOr(_ => otherValue)(_ => true) === (failed)) + assert(failed.ensureOr(_ => otherValue)(_ => false) === failed) + assert(failed.ensureOr(_ => otherValue)(_ => true) === failed) } test("reject returns the successful value if the partial function is not defined") { @@ -60,18 +60,18 @@ class MonadErrorSuite extends CatsSuite { } test("rethrow returns the failure, when applied to a Left of a failure") { - assert(failed.attempt.rethrow === (failed)) + assert(failed.attempt.rethrow === failed) } test("rethrow returns the successful value, when applied to a Right of a successful value") { - assert(successful.attempt.rethrow === (successful)) + assert(successful.attempt.rethrow === successful) } test("rethrow returns the failure, when applied to a Left of a specialized failure") { - assert(failed.attempt.asInstanceOf[Try[Either[IllegalArgumentException, Int]]].rethrow === (failed)) + assert(failed.attempt.asInstanceOf[Try[Either[IllegalArgumentException, Int]]].rethrow === failed) } test("rethrow returns the successful value, when applied to a Right of a specialized successful value") { - assert(successful.attempt.asInstanceOf[Try[Either[IllegalArgumentException, Int]]].rethrow === (successful)) + assert(successful.attempt.asInstanceOf[Try[Either[IllegalArgumentException, Int]]].rethrow === successful) } } diff --git a/tests/src/test/scala/cats/tests/MonadSuite.scala b/tests/src/test/scala/cats/tests/MonadSuite.scala index b6b1b41dc5..fd1f553c5c 100644 --- a/tests/src/test/scala/cats/tests/MonadSuite.scala +++ b/tests/src/test/scala/cats/tests/MonadSuite.scala @@ -34,26 +34,26 @@ class MonadSuite extends CatsSuite { test("untilM_") { forAll(smallPosInt) { (max: Int) => val (result, _) = increment.untilM_(StateT.inspect(_ >= max)).run(-1) - assert(result === (max)) + assert(result === max) } } test("untilM") { forAll(smallPosInt) { (max: Int) => val (result, aggregation) = incrementAndGet.untilM[Vector](StateT.inspect(_ >= max)).run(-1) - assert(result === (max)) + assert(result === max) assert(aggregation === ((0 to max).toVector)) } } test("whileM_ stack safety") { val (result, _) = increment.whileM_(StateT.inspect(i => !(i >= 50000))).run(0) - assert(result === (50000)) + assert(result === 50000) } test("whileM stack safety") { val (result, _) = incrementAndGet.whileM[Vector](StateT.inspect(i => !(i >= 50000))).run(0) - assert(result === (50000)) + assert(result === 50000) } test("iterateWhile") { @@ -65,7 +65,7 @@ class MonadSuite extends CatsSuite { test("iterateWhile stack safety") { val (result, _) = incrementAndGet.iterateWhile(_ < 50000).run(-1) - assert(result === (50000)) + assert(result === 50000) } test("iterateUntil") { @@ -77,7 +77,7 @@ class MonadSuite extends CatsSuite { test("iterateUntil stack safety") { val (result, _) = incrementAndGet.iterateUntil(_ == 50000).run(-1) - assert(result === (50000)) + assert(result === 50000) } test("iterateWhileM") { diff --git a/tests/src/test/scala/cats/tests/MonoidSuite.scala b/tests/src/test/scala/cats/tests/MonoidSuite.scala index b69abede97..0904b1883b 100644 --- a/tests/src/test/scala/cats/tests/MonoidSuite.scala +++ b/tests/src/test/scala/cats/tests/MonoidSuite.scala @@ -11,9 +11,9 @@ class MonoidSuite extends CatsSuite { } test("companion object syntax") { - assert(Monoid.empty[Int] === (0)) - assert(Monoid.isEmpty(1) === (false)) - assert(Monoid.isEmpty(0) === (true)) + assert(Monoid.empty[Int] === 0) + assert(Monoid.isEmpty(1) === false) + assert(Monoid.isEmpty(0) === true) } } diff --git a/tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala b/tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala index c4574c4ba2..6b61fea50c 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyChainSuite.scala @@ -62,7 +62,7 @@ class NonEmptyChainSuite extends NonEmptyCollectionSuite[Chain, NonEmptyChain, N } test("show") { - assert(Show[NonEmptyChain[Int]].show(NonEmptyChain(1, 2, 3)) === ("NonEmptyChain(1, 2, 3)")) + assert(Show[NonEmptyChain[Int]].show(NonEmptyChain(1, 2, 3)) === "NonEmptyChain(1, 2, 3)") } test("size is consistent with toChain.size") { @@ -73,7 +73,7 @@ class NonEmptyChainSuite extends NonEmptyCollectionSuite[Chain, NonEmptyChain, N test("filterNot and then exists should always be false") { forAll { (ci: NonEmptyChain[Int], f: Int => Boolean) => - assert(ci.filterNot(f).exists(f) === (false)) + assert(ci.filterNot(f).exists(f) === false) } } @@ -97,7 +97,7 @@ class NonEmptyChainSuite extends NonEmptyCollectionSuite[Chain, NonEmptyChain, N test("filterNot element and then contains should be false") { forAll { (ci: NonEmptyChain[Int], i: Int) => - assert(ci.filterNot(_ === i).contains(i) === (false)) + assert(ci.filterNot(_ === i).contains(i) === false) } } @@ -109,13 +109,13 @@ class NonEmptyChainSuite extends NonEmptyCollectionSuite[Chain, NonEmptyChain, N test("fromNonEmptyVector . toNonEmptyVector is id") { forAll { (ci: NonEmptyChain[Int]) => - assert(NonEmptyChain.fromNonEmptyVector(ci.toNonEmptyVector) === (ci)) + assert(NonEmptyChain.fromNonEmptyVector(ci.toNonEmptyVector) === ci) } } test("fromNonEmptyList . toNonEmptyList is id") { forAll { (ci: NonEmptyChain[Int]) => - assert(NonEmptyChain.fromNonEmptyList(ci.toNonEmptyList) === (ci)) + assert(NonEmptyChain.fromNonEmptyList(ci.toNonEmptyList) === ci) } } @@ -126,7 +126,7 @@ class NonEmptyChainSuite extends NonEmptyCollectionSuite[Chain, NonEmptyChain, N } test("fromChainUnsafe throws exception when used with empty chain") { - assert(Either.catchNonFatal(NonEmptyChain.fromChainUnsafe(Chain.empty[Int])).isLeft === (true)) + assert(Either.catchNonFatal(NonEmptyChain.fromChainUnsafe(Chain.empty[Int])).isLeft === true) } test("fromSeq . toList . iterator is id") { @@ -149,7 +149,7 @@ class NonEmptyChainSuite extends NonEmptyCollectionSuite[Chain, NonEmptyChain, N test("reverse . reverse is id") { forAll { (ci: NonEmptyChain[Int]) => - assert(ci.reverse.reverse === (ci)) + assert(ci.reverse.reverse === ci) } } diff --git a/tests/src/test/scala/cats/tests/NonEmptyListSuite.scala b/tests/src/test/scala/cats/tests/NonEmptyListSuite.scala index 5b3b1d5d40..ba2d22deff 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyListSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyListSuite.scala @@ -88,15 +88,15 @@ class NonEmptyListSuite extends NonEmptyCollectionSuite[List, NonEmptyList, NonE test("Show is not empty and is formatted as expected") { forAll { (nel: NonEmptyList[Int]) => assert(nel.show.nonEmpty) - assert(nel.show.startsWith("NonEmptyList(") === (true)) + assert(nel.show.startsWith("NonEmptyList(") === true) assert(nel.show === (implicitly[Show[NonEmptyList[Int]]].show(nel))) - assert(nel.show.contains(nel.head.show) === (true)) + assert(nel.show.contains(nel.head.show) === true) } } test("Show is formatted correctly") { val nonEmptyList = NonEmptyList("Test", Nil) - assert(nonEmptyList.show === ("NonEmptyList(Test)")) + assert(nonEmptyList.show === "NonEmptyList(Test)") } test("Creating NonEmptyList + toList is identity") { @@ -176,7 +176,7 @@ class NonEmptyListSuite extends NonEmptyCollectionSuite[List, NonEmptyList, NonE nel.toList.reverse match { case last :: rev => val expected = rev.reverse.foldRight(last)((a, b) => f(a, Now(b)).value) - assert(got === (expected)) + assert(got === expected) case _ => fail("nonempty turns out to be empty") } @@ -200,7 +200,7 @@ class NonEmptyListSuite extends NonEmptyCollectionSuite[List, NonEmptyList, NonE val expected = nel.tail.foldLeft(Option(f(nel.head))) { (opt, i) => opt.map(s => g(s, i)) } - assert(nel.reduceLeftToOption(f)(g) === (expected)) + assert(nel.reduceLeftToOption(f)(g) === expected) } } @@ -212,7 +212,7 @@ class NonEmptyListSuite extends NonEmptyCollectionSuite[List, NonEmptyList, NonE val expected = rev.reverse.foldRight(Option(f(last))) { (i, opt) => opt.map(s => g(i, Now(s)).value) } - assert(got === (expected)) + assert(got === expected) case _ => fail("nonempty turns out to be empty") } @@ -225,7 +225,7 @@ class NonEmptyListSuite extends NonEmptyCollectionSuite[List, NonEmptyList, NonE val expected = f(nel.head).flatMap { hd => nel.tail.foldM(hd)((acc, i) => f(i).map(acc + _)) } - assert(got === (expected)) + assert(got === expected) } } @@ -237,7 +237,7 @@ class NonEmptyListSuite extends NonEmptyCollectionSuite[List, NonEmptyList, NonE test("fromList round trip") { forAll { (l: List[Int]) => - assert(NonEmptyList.fromList(l).map(_.toList).getOrElse(List.empty) === (l)) + assert(NonEmptyList.fromList(l).map(_.toList).getOrElse(List.empty) === l) } forAll { (nel: NonEmptyList[Int]) => diff --git a/tests/src/test/scala/cats/tests/NonEmptyMapSuite.scala b/tests/src/test/scala/cats/tests/NonEmptyMapSuite.scala index 204240e643..5dd64bcea3 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyMapSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyMapSuite.scala @@ -31,16 +31,16 @@ class NonEmptyMapSuite extends CatsSuite { test("Show is not empty and is formatted as expected") { forAll { (nem: NonEmptyMap[String, Int]) => - assert(nem.show.nonEmpty === (true)) - assert(nem.show.startsWith("NonEmptySortedMap(") === (true)) + assert(nem.show.nonEmpty === true) + assert(nem.show.startsWith("NonEmptySortedMap(") === true) assert(nem.show === (implicitly[Show[NonEmptyMap[String, Int]]].show(nem))) - assert(nem.show.contains(nem.head._2.show) === (true)) + assert(nem.show.contains(nem.head._2.show) === true) } } test("Show is formatted correctly") { val nonEmptyMap = NonEmptyMap.one("Key", "Test") - assert(nonEmptyMap.show === ("NonEmptySortedMap(Key -> Test)")) + assert(nonEmptyMap.show === "NonEmptySortedMap(Key -> Test)") } test("NonEmptyMap#filter is consistent with Map#filter") { @@ -111,7 +111,7 @@ class NonEmptyMapSuite extends CatsSuite { val expected = Foldable[SortedMap[String, *]] .foldRight(rev, Now(last._2))((a, b) => f(a, b)) .value - assert(got === (expected)) + assert(got === expected) } } @@ -132,7 +132,7 @@ class NonEmptyMapSuite extends CatsSuite { val expected = nem.tail.foldLeft(Option(f(nem.head._2))) { (opt, i) => opt.map(s => g(s, i._2)) } - assert(nem.reduceLeftToOption(f)(g) === (expected)) + assert(nem.reduceLeftToOption(f)(g) === expected) } } @@ -144,7 +144,7 @@ class NonEmptyMapSuite extends CatsSuite { val expected = rev.foldRight(Option(f(last._2))) { (i, opt) => opt.map(s => g(i._2, Now(s)).value) } - assert(got === (expected)) + assert(got === expected) } } @@ -154,7 +154,7 @@ class NonEmptyMapSuite extends CatsSuite { val expected = f(nem.head._2).flatMap { hd => nem.tail.foldM(hd)((acc, i) => f(i).map(acc + _)) } - assert(got === (expected)) + assert(got === expected) } } @@ -166,7 +166,7 @@ class NonEmptyMapSuite extends CatsSuite { test("fromMap round trip") { forAll { (l: SortedMap[String, Int]) => - assert(NonEmptyMap.fromMap(l).map(_.toSortedMap).getOrElse(SortedMap.empty[String, Int]) === (l)) + assert(NonEmptyMap.fromMap(l).map(_.toSortedMap).getOrElse(SortedMap.empty[String, Int]) === l) } forAll { (nem: NonEmptyMap[String, Int]) => diff --git a/tests/src/test/scala/cats/tests/NonEmptySetSuite.scala b/tests/src/test/scala/cats/tests/NonEmptySetSuite.scala index 4ae00fade6..1e3a96c447 100644 --- a/tests/src/test/scala/cats/tests/NonEmptySetSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptySetSuite.scala @@ -61,7 +61,7 @@ class NonEmptySetSuite extends CatsSuite { test("Show is formatted correctly") { val nonEmptySet = NonEmptySet("Test", SortedSet.empty[String]) - assert(nonEmptySet.show === ("NonEmptySortedSet(Test)")) + assert(nonEmptySet.show === "NonEmptySortedSet(Test)") } test("Creating NonEmptySet + toSet is identity") { @@ -133,7 +133,7 @@ class NonEmptySetSuite extends CatsSuite { val last = nes.last val rev = nes - last val expected = rev.foldRight(last)((a, b) => f(a, Now(b)).value) - assert(got === (expected)) + assert(got === expected) } } @@ -154,7 +154,7 @@ class NonEmptySetSuite extends CatsSuite { val expected = nes.tail.foldLeft(Option(f(nes.head))) { (opt, i) => opt.map(s => g(s, i)) } - assert(nes.reduceLeftToOption(f)(g) === (expected)) + assert(nes.reduceLeftToOption(f)(g) === expected) } } @@ -166,7 +166,7 @@ class NonEmptySetSuite extends CatsSuite { val expected = rev.foldRight(Option(f(last))) { (i, opt) => opt.map(s => g(i, Now(s)).value) } - assert(got === (expected)) + assert(got === expected) } } @@ -176,7 +176,7 @@ class NonEmptySetSuite extends CatsSuite { val expected = f(nes.head).flatMap { hd => nes.tail.foldM(hd)((acc, i) => f(i).map(acc + _)) } - assert(got === (expected)) + assert(got === expected) } } @@ -188,7 +188,7 @@ class NonEmptySetSuite extends CatsSuite { test("fromSet round trip") { forAll { (l: SortedSet[Int]) => - assert(NonEmptySet.fromSet(l).map(_.toSortedSet).getOrElse(SortedSet.empty[Int]) === (l)) + assert(NonEmptySet.fromSet(l).map(_.toSortedSet).getOrElse(SortedSet.empty[Int]) === l) } forAll { (nes: NonEmptySet[Int]) => diff --git a/tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala b/tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala index 3ac6665d1b..90d2f32dbc 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyVectorSuite.scala @@ -99,19 +99,19 @@ class NonEmptyVectorSuite extends NonEmptyCollectionSuite[Vector, NonEmptyVector test("Show is not empty and is formatted as expected") { forAll { (nonEmptyVector: NonEmptyVector[Int]) => - assert(nonEmptyVector.show.nonEmpty === (true)) - assert(nonEmptyVector.show.startsWith("NonEmptyVector(") === (true)) + assert(nonEmptyVector.show.nonEmpty === true) + assert(nonEmptyVector.show.startsWith("NonEmptyVector(") === true) assert(nonEmptyVector.show === (implicitly[Show[NonEmptyVector[Int]]].show(nonEmptyVector))) - assert(nonEmptyVector.show.contains(nonEmptyVector.head.show) === (true)) + assert(nonEmptyVector.show.contains(nonEmptyVector.head.show) === true) } } test("Show is formatted correctly") { val v1 = NonEmptyVector("Test", Vector.empty) - assert(v1.show === ("NonEmptyVector(Test)")) + assert(v1.show === "NonEmptyVector(Test)") val v2 = NonEmptyVector.of("foo", "bar", "baz") - assert(v2.show === ("NonEmptyVector(foo, bar, baz)")) + assert(v2.show === "NonEmptyVector(foo, bar, baz)") } test("Creating NonEmptyVector + toVector is identity") { @@ -178,7 +178,7 @@ class NonEmptyVectorSuite extends NonEmptyCollectionSuite[Vector, NonEmptyVector val got = nonEmptyVector.reduceRight(f).value val (first, last) = excise(nonEmptyVector.toVector) val expected = first.foldRight(last)((a, b) => f(a, Now(b)).value) - assert(got === (expected)) + assert(got === expected) } } @@ -199,7 +199,7 @@ class NonEmptyVectorSuite extends NonEmptyCollectionSuite[Vector, NonEmptyVector val expected = nonEmptyVector.tail.foldLeft(Option(f(nonEmptyVector.head))) { (opt, i) => opt.map(s => g(s, i)) } - assert(nonEmptyVector.reduceLeftToOption(f)(g) === (expected)) + assert(nonEmptyVector.reduceLeftToOption(f)(g) === expected) } } @@ -209,7 +209,7 @@ class NonEmptyVectorSuite extends NonEmptyCollectionSuite[Vector, NonEmptyVector val expected = first.foldRight(Option(f(last))) { (i, opt) => opt.map(s => g(i, Now(s)).value) } - assert(nonEmptyVector.reduceRightToOption(f)(g).value === (expected)) + assert(nonEmptyVector.reduceRightToOption(f)(g).value === expected) } } @@ -265,7 +265,7 @@ class NonEmptyVectorSuite extends NonEmptyCollectionSuite[Vector, NonEmptyVector test("prependVector with an empty Vector is the same as the original NonEmptyVector") { forAll { (nonEmptyVector: NonEmptyVector[Int]) => - assert(nonEmptyVector.prependVector(Vector.empty) === (nonEmptyVector)) + assert(nonEmptyVector.prependVector(Vector.empty) === nonEmptyVector) } } @@ -278,7 +278,7 @@ class NonEmptyVectorSuite extends NonEmptyCollectionSuite[Vector, NonEmptyVector test("NonEmptyVector#get returns a None when the element does not exist") { forAll { (nonEmptyVector: NonEmptyVector[Int]) => val size = nonEmptyVector.toVector.size - assert(nonEmptyVector.get(size) === (None)) + assert(nonEmptyVector.get(size) === None) } } @@ -294,7 +294,7 @@ class NonEmptyVectorSuite extends NonEmptyCollectionSuite[Vector, NonEmptyVector test("NonEmptyVector#updated returns a None when the element does not exist") { forAll { (nonEmptyVector: NonEmptyVector[Int], element: Int) => val size = nonEmptyVector.toVector.size - assert(nonEmptyVector.updated(size, element) === (None)) + assert(nonEmptyVector.updated(size, element) === None) } } @@ -323,8 +323,8 @@ class NonEmptyVectorSuite extends NonEmptyCollectionSuite[Vector, NonEmptyVector forAll { (nonEmptyVector: NonEmptyVector[Int]) => assert(nonEmptyVector.toString === (s"NonEmpty${nonEmptyVector.toVector.toString}")) } - assert(NonEmptyVector(1, Vector.empty).toString === ("NonEmptyVector(1)")) - assert(NonEmptyVector(1, Vector.empty).toVector.toString === ("Vector(1)")) + assert(NonEmptyVector(1, Vector.empty).toString === "NonEmptyVector(1)") + assert(NonEmptyVector(1, Vector.empty).toVector.toString === "Vector(1)") } test("NonEmptyVector.unapply supports pattern matching") { @@ -372,7 +372,7 @@ class NonEmptyVectorSuite extends NonEmptyCollectionSuite[Vector, NonEmptyVector test("NonEmptyVector#zipWith is consistent with #zipWithIndex") { forAll { (nev: NonEmptyVector[Int]) => val zw = nev.zipWith(NonEmptyVector.fromVectorUnsafe((0 until nev.length).toVector))(Tuple2.apply) - assert(nev.zipWithIndex === (zw)) + assert(nev.zipWithIndex === zw) } } @@ -381,8 +381,8 @@ class NonEmptyVectorSuite extends NonEmptyCollectionSuite[Vector, NonEmptyVector val sorted = NonEmptyVector.fromVectorUnsafe(nev.map(f).toVector.sorted) val ior = Reducible[NonEmptyVector].nonEmptyPartition(sorted)(identity) - assert(ior.left.map(xs => xs.sorted === (xs)).getOrElse(true)) - assert(ior.right.map(xs => xs.sorted === (xs)).getOrElse(true)) + assert(ior.left.map(xs => xs.sorted === xs).getOrElse(true)) + assert(ior.right.map(xs => xs.sorted === xs).getOrElse(true)) } } @@ -423,8 +423,8 @@ class NonEmptyVectorSuite extends NonEmptyCollectionSuite[Vector, NonEmptyVector test("NonEmptyVector#zipWithIndex is consistent with Vector#zipWithIndex") { forAll { (nonEmptyVector: NonEmptyVector[Int]) => val expected = NonEmptyVector.fromVectorUnsafe(nonEmptyVector.toVector.zipWithIndex) - assert(nonEmptyVector.zipWithIndex === (expected)) - assert(Traverse[NonEmptyVector].zipWithIndex(nonEmptyVector) === (expected)) + assert(nonEmptyVector.zipWithIndex === expected) + assert(Traverse[NonEmptyVector].zipWithIndex(nonEmptyVector) === expected) } } diff --git a/tests/src/test/scala/cats/tests/OptionSuite.scala b/tests/src/test/scala/cats/tests/OptionSuite.scala index 70c518e6cd..aa247585df 100644 --- a/tests/src/test/scala/cats/tests/OptionSuite.scala +++ b/tests/src/test/scala/cats/tests/OptionSuite.scala @@ -47,8 +47,8 @@ class OptionSuite extends CatsSuite { checkAll("Align[Option]", SerializableTests.serializable(Align[Option])) test("show") { - assert(none[Int].show === ("None")) - assert(1.some.show === ("Some(1)")) + assert(none[Int].show === "None") + assert(1.some.show === "Some(1)") forAll { (fs: Option[String]) => assert(fs.show === (fs.toString)) @@ -102,12 +102,12 @@ class OptionSuite extends CatsSuite { test(".some with null argument still results in Some #871") { val s: String = null // can't use `s.some === (Some(null))` here, because it leads to NullPointerException) - assert(s.some.exists(_ == null) === (true)) + assert(s.some.exists(_ == null) === true) } test("map2Eval is lazy") { val bomb: Eval[Option[Int]] = Later(sys.error("boom")) - assert(none[Int].map2Eval(bomb)(_ + _).value === (None)) + assert(none[Int].map2Eval(bomb)(_ + _).value === None) } test("toOptionT consistency") { diff --git a/tests/src/test/scala/cats/tests/OptionTSuite.scala b/tests/src/test/scala/cats/tests/OptionTSuite.scala index 13e34e8098..68facd12da 100644 --- a/tests/src/test/scala/cats/tests/OptionTSuite.scala +++ b/tests/src/test/scala/cats/tests/OptionTSuite.scala @@ -437,7 +437,7 @@ class OptionTSuite extends CatsSuite { test("show") { val either: Either[String, Option[Int]] = Either.right(Some(1)) - assert(OptionT[Either[String, *], Int](either).show === ("Right(Some(1))")) + assert(OptionT[Either[String, *], Int](either).show === "Right(Some(1))") } test("none") { diff --git a/tests/src/test/scala/cats/tests/ParallelSuite.scala b/tests/src/test/scala/cats/tests/ParallelSuite.scala index ec6783f212..41f4e5947a 100644 --- a/tests/src/test/scala/cats/tests/ParallelSuite.scala +++ b/tests/src/test/scala/cats/tests/ParallelSuite.scala @@ -30,7 +30,7 @@ class ParallelSuite extends CatsSuite with ApplicativeErrorForEitherTest with Sc } .foldMap(identity) - assert(es.parSequence.fold(identity, i => Monoid[String].empty) === (lefts)) + assert(es.parSequence.fold(identity, i => Monoid[String].empty) === lefts) } } @@ -42,7 +42,7 @@ class ParallelSuite extends CatsSuite with ApplicativeErrorForEitherTest with Sc case Some(e) => e } .foldMap(identity) - assert(es.parSequence.left.getOrElse(Monoid[String].empty) === (lefts)) + assert(es.parSequence.left.getOrElse(Monoid[String].empty) === lefts) } } @@ -125,7 +125,7 @@ class ParallelSuite extends CatsSuite with ApplicativeErrorForEitherTest with Sc } .foldMap(identity) - assert(es.parBisequence.fold(identity, i => Monoid[String].empty) === (lefts)) + assert(es.parBisequence.fold(identity, i => Monoid[String].empty) === lefts) } } @@ -141,7 +141,7 @@ class ParallelSuite extends CatsSuite with ApplicativeErrorForEitherTest with Sc } .foldMap(identity) - assert(es.parBisequence.left.getOrElse(Monoid[String].empty) === (lefts)) + assert(es.parBisequence.left.getOrElse(Monoid[String].empty) === lefts) } } @@ -165,7 +165,7 @@ class ParallelSuite extends CatsSuite with ApplicativeErrorForEitherTest with Sc } .foldMap(identity) - assert(es.parLeftSequence.fold(identity, i => Monoid[String].empty) === (lefts)) + assert(es.parLeftSequence.fold(identity, i => Monoid[String].empty) === lefts) } } @@ -180,7 +180,7 @@ class ParallelSuite extends CatsSuite with ApplicativeErrorForEitherTest with Sc } .foldMap(identity) - assert(es.parLeftSequence.left.getOrElse(Monoid[String].empty) === (lefts)) + assert(es.parLeftSequence.left.getOrElse(Monoid[String].empty) === lefts) } } @@ -305,7 +305,7 @@ class ParallelSuite extends CatsSuite with ApplicativeErrorForEitherTest with Sc case (a, b) => a + b } - assert((as, bs, cs).parMapN(_ + _ + _) === (zipped)) + assert((as, bs, cs).parMapN(_ + _ + _) === zipped) } } @@ -321,7 +321,7 @@ class ParallelSuite extends CatsSuite with ApplicativeErrorForEitherTest with Sc case (a, b) => a + b } - assert((as, bs, cs).parMapN(_ + _ + _) === (zipped)) + assert((as, bs, cs).parMapN(_ + _ + _) === zipped) } } @@ -337,7 +337,7 @@ class ParallelSuite extends CatsSuite with ApplicativeErrorForEitherTest with Sc case (a, b) => a + b } - assert((as, bs, cs).parMapN(_ + _ + _) === (zipped)) + assert((as, bs, cs).parMapN(_ + _ + _) === zipped) } } diff --git a/tests/src/test/scala/cats/tests/QueueSuite.scala b/tests/src/test/scala/cats/tests/QueueSuite.scala index 8638bcc602..3f2a01362e 100644 --- a/tests/src/test/scala/cats/tests/QueueSuite.scala +++ b/tests/src/test/scala/cats/tests/QueueSuite.scala @@ -38,8 +38,8 @@ class QueueSuite extends CatsSuite { checkAll("Queue[Int]", ShortCircuitingTests[Queue].traverseFilter[Int]) test("show") { - assert(Queue(1, 2, 3).show === ("Queue(1, 2, 3)")) - assert(Queue.empty[Int].show === ("Queue()")) + assert(Queue(1, 2, 3).show === "Queue(1, 2, 3)") + assert(Queue.empty[Int].show === "Queue()") } test("traverse is stack-safe") { diff --git a/tests/src/test/scala/cats/tests/ReducibleSuite.scala b/tests/src/test/scala/cats/tests/ReducibleSuite.scala index 2cd4d3e0ec..e368782c38 100644 --- a/tests/src/test/scala/cats/tests/ReducibleSuite.scala +++ b/tests/src/test/scala/cats/tests/ReducibleSuite.scala @@ -29,7 +29,7 @@ class ReducibleSuiteAdditional extends CatsSuite { val nel = NonEmptyList.of(1, 2, 3) assert(R.get(nel)(1L) === (nel.get(1L))) assert(R.size(nel) === (nel.size.toLong)) - assert(R.get(nel)(4L) === (None)) + assert(R.get(nel)(4L) === None) } test("Reducible[NonEmptyList]") { @@ -39,15 +39,15 @@ class ReducibleSuiteAdditional extends CatsSuite { val tail = (2 to 10).toList val total = 1 + tail.sum val nel = NonEmptyList(1, tail) - assert(R.reduceLeft(nel)(_ + _) === (total)) - assert(R.reduceRight(nel)((x, ly) => ly.map(x + _)).value === (total)) - assert(R.reduce(nel) === (total)) + assert(R.reduceLeft(nel)(_ + _) === total) + assert(R.reduceRight(nel)((x, ly) => ly.map(x + _)).value === total) + assert(R.reduce(nel) === total) // more basic checks val names = NonEmptyList.of("Aaron", "Betty", "Calvin", "Deirdra") val totalLength = names.toList.map(_.length).sum - assert(R.reduceLeftTo(names)(_.length)((sum, s) => s.length + sum) === (totalLength)) - assert(R.reduceMap(names)(_.length) === (totalLength)) + assert(R.reduceLeftTo(names)(_.length)((sum, s) => s.length + sum) === totalLength) + assert(R.reduceMap(names)(_.length) === totalLength) val sumLeftM = R.reduceLeftM(names)(Some(_): Option[String]) { (acc, x) => (Some(acc + x): Option[String]) } diff --git a/tests/src/test/scala/cats/tests/RegressionSuite.scala b/tests/src/test/scala/cats/tests/RegressionSuite.scala index 579eb909a4..d73cdbd9d2 100644 --- a/tests/src/test/scala/cats/tests/RegressionSuite.scala +++ b/tests/src/test/scala/cats/tests/RegressionSuite.scala @@ -61,10 +61,10 @@ class RegressionSuite extends CatsSuite with ScalaVersionSpecificRegressionSuite val state = Traverse[List].sequence[State[Int, *], Person](allocated) val (people, counter) = state.run(0) assert(people === (List(Person(0, "Alice"), Person(1, "Bob"), Person(2, "Claire")))) - assert(counter === (3)) + assert(counter === 3) // ensure that side-effects occurred in "correct" order - assert(buf.toList === (names)) + assert(buf.toList === names) } test("#167: confirm ap2 order") { @@ -75,7 +75,7 @@ class RegressionSuite extends CatsSuite with ScalaVersionSpecificRegressionSuite ) .run("") ._2 - assert(twelve === ("12")) + assert(twelve === "12") } test("#167: confirm map2 order") { @@ -86,7 +86,7 @@ class RegressionSuite extends CatsSuite with ScalaVersionSpecificRegressionSuite )((_: Unit, _: Unit) => ()) .run("") ._2 - assert(twelve === ("12")) + assert(twelve === "12") } test("#167: confirm map3 order") { @@ -98,7 +98,7 @@ class RegressionSuite extends CatsSuite with ScalaVersionSpecificRegressionSuite )((_: Unit, _: Unit, _: Unit) => ()) .run("") ._2 - assert(oneTwoThree === ("123")) + assert(oneTwoThree === "123") } test("#500: foldMap - traverse consistency") { @@ -115,7 +115,7 @@ class RegressionSuite extends CatsSuite with ScalaVersionSpecificRegressionSuite } def checkAndResetCount(expected: Int): Unit = { - assert(count === (expected)) + assert(count === expected) count = 0 } diff --git a/tests/src/test/scala/cats/tests/SetSuite.scala b/tests/src/test/scala/cats/tests/SetSuite.scala index 617eb5388e..ec4aba1264 100644 --- a/tests/src/test/scala/cats/tests/SetSuite.scala +++ b/tests/src/test/scala/cats/tests/SetSuite.scala @@ -18,8 +18,8 @@ class SetSuite extends CatsSuite { checkAll("UnorderedTraverse[Set]", SerializableTests.serializable(UnorderedTraverse[Set])) test("show") { - assert(Set(1, 1, 2, 3).show === ("Set(1, 2, 3)")) - assert(Set.empty[String].show === ("Set()")) + assert(Set(1, 1, 2, 3).show === "Set(1, 2, 3)") + assert(Set.empty[String].show === "Set()") } test("show keeps separate entries for items that map to identical strings") { @@ -28,6 +28,6 @@ class SetSuite extends CatsSuite { // an implementation implemented as set.map(_.show).mkString(", ") would // only show one entry in the result instead of 3, because Set.map combines // duplicate items in the codomain. - assert(Set(1, 2, 3).show === ("Set(1, 1, 1)")) + assert(Set(1, 2, 3).show === "Set(1, 1, 1)") } } diff --git a/tests/src/test/scala/cats/tests/SortedSetSuite.scala b/tests/src/test/scala/cats/tests/SortedSetSuite.scala index 95f5fdfdc4..9d26fa923f 100644 --- a/tests/src/test/scala/cats/tests/SortedSetSuite.scala +++ b/tests/src/test/scala/cats/tests/SortedSetSuite.scala @@ -53,7 +53,7 @@ class SortedSetSuite extends CatsSuite { // an implementation implemented as set.map(_.show).mkString(", ") would // only show one entry in the result instead of 3, because SortedSet.map combines // duplicate items in the codomain. - assert(SortedSet(1, 2, 3).show === ("SortedSet(1, 1, 1)")) + assert(SortedSet(1, 2, 3).show === "SortedSet(1, 1, 1)") } } diff --git a/tests/src/test/scala/cats/tests/TrySuite.scala b/tests/src/test/scala/cats/tests/TrySuite.scala index 15ce7f7291..2829077ef7 100644 --- a/tests/src/test/scala/cats/tests/TrySuite.scala +++ b/tests/src/test/scala/cats/tests/TrySuite.scala @@ -84,7 +84,7 @@ class TrySuite extends CatsSuite { test("fromTry works") { forAll { (t: Try[Int]) => - assert((MonadError[Try, Throwable].fromTry(t)) === (t)) + assert((MonadError[Try, Throwable].fromTry(t)) === t) } } @@ -134,6 +134,6 @@ class TrySuite extends CatsSuite { var evals = 0 val bomb: Eval[Try[Int]] = Later { evals += 1; Success(1) } Try[Int](sys.error("boom0")).map2Eval(bomb)(_ + _).value - assert(evals === (0)) + assert(evals === 0) } } diff --git a/tests/src/test/scala/cats/tests/Tuple2KSuite.scala b/tests/src/test/scala/cats/tests/Tuple2KSuite.scala index c368cc0241..293cb889b5 100644 --- a/tests/src/test/scala/cats/tests/Tuple2KSuite.scala +++ b/tests/src/test/scala/cats/tests/Tuple2KSuite.scala @@ -179,7 +179,7 @@ class Tuple2KSuite extends CatsSuite { forAll { (l1: Option[String], l2: List[String]) => val tuple = Tuple2K(l1, l2) - assert(tuple.swap.swap === (tuple)) + assert(tuple.swap.swap === tuple) } } diff --git a/tests/src/test/scala/cats/tests/TupleSuite.scala b/tests/src/test/scala/cats/tests/TupleSuite.scala index 558faa0d88..a713d69fea 100644 --- a/tests/src/test/scala/cats/tests/TupleSuite.scala +++ b/tests/src/test/scala/cats/tests/TupleSuite.scala @@ -67,10 +67,10 @@ class TupleSuite extends CatsSuite { test("eqv") { val eq = Eq[(Int, Long)] forAll { (t: (Int, Long)) => - assert(eq.eqv(t, t) === (true)) + assert(eq.eqv(t, t) === true) } forAll { (t: (Int, Long)) => - assert(eq.eqv(t, t._1 -> (t._2 + 1)) === (false)) + assert(eq.eqv(t, t._1 -> (t._2 + 1)) === false) } } @@ -82,7 +82,7 @@ class TupleSuite extends CatsSuite { } test("show") { - assert((1, 2).show === ("(1,2)")) + assert((1, 2).show === "(1,2)") forAll { (fs: (String, String)) => assert(fs.show === (fs.toString)) diff --git a/tests/src/test/scala/cats/tests/ValidatedSuite.scala b/tests/src/test/scala/cats/tests/ValidatedSuite.scala index c5283a7bc0..281afc9c0a 100644 --- a/tests/src/test/scala/cats/tests/ValidatedSuite.scala +++ b/tests/src/test/scala/cats/tests/ValidatedSuite.scala @@ -125,24 +125,24 @@ class ValidatedSuite extends CatsSuite { test("ValidatedNel") { forAll { (e: String) => val manual = Validated.invalid[NonEmptyList[String], Int](NonEmptyList.of(e)) - assert(Validated.invalidNel[String, Int](e) === (manual)) - assert(Validated.invalid[String, Int](e).toValidatedNel === (manual)) + assert(Validated.invalidNel[String, Int](e) === manual) + assert(Validated.invalid[String, Int](e).toValidatedNel === manual) } } test("ValidatedNec") { forAll { (e: String) => val manual = Validated.invalid[NonEmptyChain[String], Int](NonEmptyChain.one(e)) - assert(Validated.invalidNec[String, Int](e) === (manual)) - assert(Validated.invalid[String, Int](e).toValidatedNec === (manual)) + assert(Validated.invalidNec[String, Int](e) === manual) + assert(Validated.invalid[String, Int](e).toValidatedNec === manual) } } test("isInvalid consistent with forall and exists") { forAll { (v: Validated[String, Int], p: Int => Boolean) => if (v.isInvalid) { - assert(v.forall(p) === (true)) - assert(v.exists(p) === (false)) + assert(v.forall(p) === true) + assert(v.exists(p) === false) } else { assert(v.forall(p) === (v.exists(p))) } @@ -197,7 +197,7 @@ class ValidatedSuite extends CatsSuite { test("toEither then fromEither is identity") { forAll { (v: Validated[String, Int]) => - assert(Validated.fromEither(v.toEither) === (v)) + assert(Validated.fromEither(v.toEither) === v) } } @@ -211,7 +211,7 @@ class ValidatedSuite extends CatsSuite { test("show isn't empty") { forAll { (v: Validated[String, Int]) => val show = implicitly[Show[Validated[String, Int]]] - assert(show.show(v).nonEmpty === (true)) + assert(show.show(v).nonEmpty === true) } } @@ -239,7 +239,7 @@ class ValidatedSuite extends CatsSuite { test("fromOption consistent with toOption") { forAll { (o: Option[Int], s: String) => - assert(Validated.fromOption(o, s).toOption === (o)) + assert(Validated.fromOption(o, s).toOption === o) } } @@ -251,7 +251,7 @@ class ValidatedSuite extends CatsSuite { test("toIor then fromEither is identity") { forAll { (v: Validated[String, Int]) => - assert(Validated.fromIor(v.toIor) === (v)) + assert(Validated.fromIor(v.toIor) === v) } } @@ -269,7 +269,7 @@ class ValidatedSuite extends CatsSuite { test("double swap is identity") { forAll { (x: Validated[String, Int]) => - assert(x.swap.swap === (x)) + assert(x.swap.swap === x) } } @@ -292,7 +292,7 @@ class ValidatedSuite extends CatsSuite { test("ensure on Invalid is identity") { forAll { (x: Validated[Int, String], i: Int, p: String => Boolean) => if (x.isInvalid) { - assert(x.ensure(i)(p) === (x)) + assert(x.ensure(i)(p) === x) } } } @@ -308,7 +308,7 @@ class ValidatedSuite extends CatsSuite { test("ensureOr on Invalid is identity") { forAll { (x: Validated[Int, String], f: String => Int, p: String => Boolean) => if (x.isInvalid) { - assert(x.ensureOr(f)(p) === (x)) + assert(x.ensureOr(f)(p) === x) } } } diff --git a/tests/src/test/scala/cats/tests/VectorSuite.scala b/tests/src/test/scala/cats/tests/VectorSuite.scala index 886c7484be..be3d773622 100644 --- a/tests/src/test/scala/cats/tests/VectorSuite.scala +++ b/tests/src/test/scala/cats/tests/VectorSuite.scala @@ -48,9 +48,9 @@ class VectorSuite extends CatsSuite { checkAll("ZipVector[Int]", CommutativeApplyTests[ZipVector].commutativeApply[Int, Int, Int]) test("show") { - assert(Vector(1, 2, 3).show === ("Vector(1, 2, 3)")) + assert(Vector(1, 2, 3).show === "Vector(1, 2, 3)") - assert(Vector.empty[Int].show === ("Vector()")) + assert(Vector.empty[Int].show === "Vector()") forAll { (vec: Vector[String]) => assert(vec.show === (vec.toString)) diff --git a/tests/src/test/scala/cats/tests/WordCountSuite.scala b/tests/src/test/scala/cats/tests/WordCountSuite.scala index cfb31e4953..a30a8400c1 100644 --- a/tests/src/test/scala/cats/tests/WordCountSuite.scala +++ b/tests/src/test/scala/cats/tests/WordCountSuite.scala @@ -47,8 +47,8 @@ class WordCountSuite extends CatsSuite { val lineCount = allResults.first.second val charCount = allResults.second val wordCount = wordCountState.value.runA(false).value - assert(charCount.getConst === (96)) - assert(lineCount.getConst === (2)) - assert(wordCount.getConst === (17)) + assert(charCount.getConst === 96) + assert(lineCount.getConst === 2) + assert(wordCount.getConst === 17) } } diff --git a/tests/src/test/scala/cats/tests/WriterTSuite.scala b/tests/src/test/scala/cats/tests/WriterTSuite.scala index bd1f33af97..9c4220be28 100644 --- a/tests/src/test/scala/cats/tests/WriterTSuite.scala +++ b/tests/src/test/scala/cats/tests/WriterTSuite.scala @@ -37,7 +37,7 @@ class WriterTSuite extends CatsSuite { test("double swap is a noop") { forAll { (w: WriterT[List, Int, Int]) => - assert(w.swap.swap === (w)) + assert(w.swap.swap === w) } } @@ -57,31 +57,31 @@ class WriterTSuite extends CatsSuite { test("tell + written is identity") { forAll { (i: Int) => - assert(WriterT.tell[Id, Int](i).written === (i)) + assert(WriterT.tell[Id, Int](i).written === i) } } test("value + value is identity") { forAll { (i: Int) => - assert(WriterT.value[Id, Int, Int](i).value === (i)) + assert(WriterT.value[Id, Int, Int](i).value === i) } } test("valueT + value is identity") { forAll { (i: Int) => - assert(WriterT.valueT[Id, Int, Int](i).value === (i)) + assert(WriterT.valueT[Id, Int, Int](i).value === i) } } test("value + listen + map(_._1) + value is identity") { forAll { (i: Int) => - assert(WriterT.value[Id, Int, Int](i).listen.map(_._1).value === (i)) + assert(WriterT.value[Id, Int, Int](i).listen.map(_._1).value === i) } } test("tell + listen + map(_._2) + value is identity") { forAll { (i: Int) => - assert(WriterT.tell[Id, Int](i).listen.map(_._2).value === (i)) + assert(WriterT.tell[Id, Int](i).listen.map(_._2).value === i) } } @@ -95,7 +95,7 @@ class WriterTSuite extends CatsSuite { test("show") { val writerT: WriterT[Id, List[String], String] = WriterT.put("foo")(List("Some log message")) - assert(writerT.show === ("(List(Some log message),foo)")) + assert(writerT.show === "(List(Some log message),foo)") } test("tell appends to log") { @@ -106,7 +106,7 @@ class WriterTSuite extends CatsSuite { } test("tell instantiates a Writer") { - assert(Writer.tell("foo").written === ("foo")) + assert(Writer.tell("foo").written === "foo") } test("listen returns a tuple of value and log") {