File tree 8 files changed +17
-26
lines changed
cats-tests/src/test/scala/com/olegpy/bm4
pcplod-tests/src/test/scala/com/olegpy/bm4
plugin-tests/src/test/scala/com/olegpy/bm4
scalaz-tests/src/test/scala/com/olegpy/bm4
8 files changed +17
-26
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,7 @@ ThisBuild / homepage := Some(url("https://github.com/oleg-py/better-monadic-for")
13
13
ThisBuild / scalaVersion := Option (System .getenv(" SCALA_VERSION" )).filter(_.nonEmpty).getOrElse(scala213)
14
14
15
15
val testSettings = Seq (
16
- libraryDependencies ++= Seq (
17
- CrossVersion .partialVersion(scalaVersion.value) match {
18
- case Some ((2 , 13 )) =>
19
- // bincompatible enough :)
20
- " org.scalatest" % " scalatest_2.13.0-RC3" % " 3.1.0-SNAP12" % Test
21
- case _ => " org.scalatest" %% " scalatest" % " 3.1.0-SNAP12" % Test
22
- }
23
-
24
- ),
16
+ libraryDependencies += " org.scalatest" %% " scalatest" % " 3.1.2" % Test ,
25
17
Test / scalacOptions ++= {
26
18
val jar = (betterMonadicFor / Compile / packageBin).value
27
19
Seq (s " -Xplugin: ${jar.getAbsolutePath}" , s " -Jdummy= ${jar.lastModified}" ) // ensures recompile
Original file line number Diff line number Diff line change 1
1
package com .olegpy .bm4
2
2
3
3
import cats .Monad
4
- import org .scalatest .FreeSpec
4
+ import org .scalatest .freespec . AnyFreeSpec
5
5
import cats .implicits ._
6
6
7
- class CatsSyntaxTest extends FreeSpec {
7
+ class CatsSyntaxTest extends AnyFreeSpec {
8
8
implicit val mcCatsInstance : cats.FlatMap [MapCheck ] = new cats.FlatMap [MapCheck ] {
9
9
def flatMap [A , B ](fa : MapCheck [A ])(f : A => MapCheck [B ]): MapCheck [B ] = {
10
10
fa.flatMap(f)
Original file line number Diff line number Diff line change 1
1
package com .olegpy .bm4
2
2
3
3
import org .ensime .pcplod ._
4
- import org .scalatest .FreeSpec
4
+ import org .scalatest .freespec . AnyFreeSpec
5
5
6
- class PresentationCompiler extends FreeSpec {
6
+ class PresentationCompiler extends AnyFreeSpec {
7
7
" PC should have no errors" in {
8
8
withMrPlod(" Arrows.scala" ) { pc =>
9
9
assert(pc.messages.isEmpty)
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package com.olegpy.bm4
3
3
import scala .concurrent .Future
4
4
import scala .concurrent .duration .Duration
5
5
6
- import org .scalatest .{ FreeSpec , FunSuite }
6
+ import org .scalatest .freespec . AnyFreeSpec
7
7
8
8
/** Mo is a lazy monad without `withFilter` */
9
9
sealed trait Mo [A ] {
@@ -26,7 +26,7 @@ object Mo {
26
26
val unit : Mo [Unit ] = Mo (())
27
27
}
28
28
29
- class TestFor extends FreeSpec {
29
+ class TestFor extends AnyFreeSpec {
30
30
31
31
" Plugin allows" - {
32
32
" destructuring for monads without withFilter" in {
Original file line number Diff line number Diff line change 1
1
package com .olegpy .bm4
2
2
3
- import org .scalatest .FreeSpec
3
+ import org .scalatest .freespec . AnyFreeSpec
4
4
5
5
object CTTest {
6
6
def foo [A ]: Mo [A ] = for {
7
7
implicit0(a : A ) <- Mo .delay(null .asInstanceOf [A ])
8
8
} yield implicitly[A ]
9
9
}
10
10
11
- class TestImplicitPatterns extends FreeSpec {
11
+ class TestImplicitPatterns extends AnyFreeSpec {
12
12
case class ImplicitTest (id : String )
13
13
def typed [A ](a : A ) = ()
14
14
case class ImplicitTest2 (id : String )
Original file line number Diff line number Diff line change 1
1
package com .olegpy .bm4
2
2
3
- import org .scalatest .FreeSpec
3
+ import org .scalatest .freespec . AnyFreeSpec
4
4
5
5
case class MapCalled () extends Exception
6
6
@@ -9,7 +9,7 @@ class MapCheck[+A](a: A) {
9
9
def flatMap [B ](f : A => MapCheck [B ]): MapCheck [B ] = f(a)
10
10
}
11
11
12
- class TestNoMap extends FreeSpec {
12
+ class TestNoMap extends AnyFreeSpec {
13
13
" emits no map(b => b) in for-comprehension" in {
14
14
for {
15
15
_ <- new MapCheck (42 )
Original file line number Diff line number Diff line change 1
1
package com .olegpy .bm4
2
2
3
3
import com .olegpy .bm4 .TestNoTuples .TupleChecker
4
- import org .scalatest .FreeSpec
4
+ import org .scalatest .freespec . AnyFreeSpec
5
5
6
-
7
- class TestNoTuples extends FreeSpec {
6
+ class TestNoTuples extends AnyFreeSpec {
8
7
" Plugin removes tuples produced in binding" - {
9
8
" for single definition" in {
10
9
for {
@@ -147,4 +146,4 @@ object TestNoTuples {
147
146
f(a)
148
147
}
149
148
}
150
- }
149
+ }
Original file line number Diff line number Diff line change 1
1
package com .olegpy .bm4
2
2
3
- import org .scalatest .FreeSpec
3
+ import org .scalatest .freespec . AnyFreeSpec
4
4
import scalaz ._ , Scalaz ._
5
5
6
- class ScalazSyntaxTest extends FreeSpec {
6
+ class ScalazSyntaxTest extends AnyFreeSpec {
7
7
implicit val scalazInstance : Bind [MapCheck ] = new Bind [MapCheck ] {
8
8
def bind [A , B ](fa : MapCheck [A ])(f : A => MapCheck [B ]): MapCheck [B ] = fa.flatMap(f)
9
9
@@ -19,4 +19,4 @@ class ScalazSyntaxTest extends FreeSpec {
19
19
20
20
sillyTest(new MapCheck (11 ), new MapCheck (42 ))
21
21
}
22
- }
22
+ }
You can’t perform that action at this time.
0 commit comments