Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant parentheses #3564

Merged
merged 1 commit into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tests/src/test/scala-2.12/cats/tests/NonEmptyStreamSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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))
}
}

Expand All @@ -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)
}
}

Expand All @@ -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)
}
}

Expand All @@ -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)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]]))

Expand Down Expand Up @@ -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)
}
}

Expand All @@ -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)
}
}

Expand All @@ -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#:+") {
Expand All @@ -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)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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] =
Expand Down Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -143,7 +143,7 @@ trait ScalaVersionSpecificRegressionSuite { self: RegressionSuite =>
}

def checkAndResetCount(expected: Int): Unit = {
assert(count === (expected))
assert(count === expected)
count = 0
}

Expand Down
6 changes: 3 additions & 3 deletions tests/src/test/scala/cats/tests/AlternativeSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand All @@ -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)
}
}

Expand All @@ -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)
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/src/test/scala/cats/tests/BitSetSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions tests/src/test/scala/cats/tests/BoundedEnumerableSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

}
20 changes: 10 additions & 10 deletions tests/src/test/scala/cats/tests/ChainSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down Expand Up @@ -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)
}
}

Expand All @@ -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)
}
}

Expand Down Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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)
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/src/test/scala/cats/tests/ConstSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions tests/src/test/scala/cats/tests/ContTSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
8 changes: 4 additions & 4 deletions tests/src/test/scala/cats/tests/DurationSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
2 changes: 1 addition & 1 deletion tests/src/test/scala/cats/tests/EitherKSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
Loading