Commit 0cf1eca2 authored by Alexander Gehrke's avatar Alexander Gehrke
Browse files

Run autofix on scalatest deprecation warnings

parent 3c3a0338
......@@ -2,8 +2,10 @@ package algebra
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class MonoidsSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class MonoidsSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
"The addditive Int monoid" should "have the right zero element" in {
Monoids.intAddition.zero shouldBe 0
}
......
......@@ -2,8 +2,10 @@ package applicative
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class ApplicativeSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class ApplicativeSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
implicit val optionApplicative = new Applicative[Option] {
override def pure[A](a: A): Option[A] = Some(a)
override def ap[A, B](ff: Option[A => B])(fa: Option[A]): Option[B] = ff.flatMap(f => fa.map(f))
......
......@@ -2,8 +2,10 @@ package applicative
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class ValidatedSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class ValidatedSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
"map2" should "accumulate errors" in {
type VSI = Validated[String, Int]
val valid1: VSI = Valid(1)
......
......@@ -2,8 +2,10 @@ package datastructures
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class ListSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class ListSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
val numbers = List(1 to 5: _*)
val single = List(1)
val strings = List("a", "b", "c")
......
......@@ -2,8 +2,10 @@ package errors
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class EitherSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class EitherSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
val l1: Either[Int, Int] = Left(1)
val l2: Either[Int, Int] = Left(2)
val r1: Either[Int, Int] = Right(1)
......
......@@ -2,8 +2,10 @@ package errors
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class OptionSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class OptionSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
"An option" should "have a map function which transforms it's content" in {
Some(3).map(_ + 1) shouldBe Some(4)
}
......
......@@ -2,8 +2,10 @@ package errors
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class TeamSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class TeamSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
"getTeam" should "return both persons ore none" in {
Team.getTeam("blar", "Dagobert") shouldBe None
Team.getTeam("Daniel", "Dagobert") shouldBe Some((Team.persons(2), Team.persons(0)))
......
......@@ -2,8 +2,10 @@ package laziness
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class LazyListSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class LazyListSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
import LazyList._
......
......@@ -2,8 +2,10 @@ package monads
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class MonadFunctorSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class MonadFunctorSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
"functorFromMonad" should "return a working functor" in {
Functor.functorFromMonad[Option](new Monad[Option] {
def pure[A](a: A): Option[A] = Some(a)
......
......@@ -2,8 +2,10 @@ package monads
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class MonadSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class MonadSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
"map2" should "combine two monadic values" in {
tupleMonad.map2(Tuple1(1), Tuple1(2))((a, b) => a + b) shouldBe Tuple1(3)
}
......
......@@ -5,8 +5,10 @@ import parsers.ContactParser.address
import parsers.lib.Parsers._
import parsers.lib._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class AddressParserSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class AddressParserSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
"The address parser" should "match an address of the form <street> <number>, <code> <city>" in {
address.parse("Hublandstraße 123, 97074 Würzburg") shouldBe Done("",Address("Hublandstraße", 123, 97074, "Würzburg"))
}
......
......@@ -5,8 +5,10 @@ import parsers.Combinators.many1
import parsers.lib.Parsers._
import parsers.lib._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class Many1Spec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class Many1Spec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
"the many1 combinator" should "match a single match of the given parser" in {
many1(string("a")).parse("abc") shouldBe Done("bc", NonEmptyList("a", Nil))
}
......
......@@ -2,8 +2,10 @@ package readerwriter
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class RandomSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class RandomSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
val initial = Simple(192837465L)
val (r1, i1) = initial.nextInt
val (r2, i2) = r1.nextInt
......
......@@ -3,8 +3,10 @@ package readerwriter
import org.scalatest._
import testutil.PendingIfUnimplemented
import java.time.LocalDate
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class ReaderSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class ReaderSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
val exampleRequest = Request(
Some("Mister X"),
"de-DE",
......
......@@ -4,8 +4,10 @@ import java.time.LocalDate
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class WriterSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class WriterSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
"collatzDepth" should "keep a log of the search" in {
val (log, _) = Writers.collatzDepth(3).v
log shouldBe List(
......
......@@ -2,9 +2,11 @@ package typeclasses
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
@SuppressWarnings(Array("org.wartremover.warts.All"))
class FunctorSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class FunctorSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
"The Functor instance for Option" should "be available in implicit scope" in {
"implicitly[Functor[Option]]" should compile
}
......
......@@ -2,9 +2,11 @@ package typeclasses
import org.scalatest._
import testutil.PendingIfUnimplemented
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
@SuppressWarnings(Array("org.wartremover.warts.All"))
class ShowSpec extends FlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
class ShowSpec extends AnyFlatSpec with Matchers with AppendedClues with PendingIfUnimplemented {
"The Show instance for Person" should "be available in implicit scope" in {
"implicitly[Show[Person]]" should compile
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment