Skip to content

Commit d6744f4

Browse files
committed
scala -> 2.13 + scalatest migration upgrade. | TODO: Replace placeholder code (C) whatthecommit.com :)
1 parent 7e4d62b commit d6744f4

File tree

6 files changed

+21
-24
lines changed

6 files changed

+21
-24
lines changed

build.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ repositories {
1919
}
2020

2121
dependencies {
22-
val scalaVersion = "2.12"
22+
val scalaVersion = "2.13"
2323
// Use Scala 2.12 in our application project
24-
implementation("org.scala-lang:scala-library:$scalaVersion.8")
24+
implementation("org.scala-lang:scala-library:$scalaVersion.5")
2525

2626
// Use Scalatest for testing our application
27-
testImplementation("junit:junit:4.13.2")
28-
testImplementation("org.scalatest:scalatest_$scalaVersion:3.0.5")
27+
testImplementation("org.scalatestplus:junit-4-13_$scalaVersion:3.2.8.0")
28+
testImplementation("org.scalatest:scalatest_$scalaVersion:3.2.8")
29+
testImplementation("org.scalatest:scalatest-funsuite_$scalaVersion:3.2.8")
2930

3031
// Need scala-xml at test runtime
31-
testRuntimeOnly("org.scala-lang.modules:scala-xml_$scalaVersion:1.1.1")
32+
testRuntimeOnly("org.scala-lang.modules:scala-xml_$scalaVersion:1.3.0") // 2.0.0-RC1
3233
}
3334

3435
tasks {

src/test/scala/com/github/daggerok/CallByValueVsCallByNameSuite.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
package com.github.daggerok
55

66
import org.junit.runner.RunWith
7-
import org.scalatest.FunSuite
8-
import org.scalatest.junit.JUnitRunner
9-
10-
import scala.annotation.tailrec
7+
import org.scalatest.funsuite.AnyFunSuite
8+
import org.scalatestplus.junit.JUnitRunner
119

1210
@RunWith(classOf[JUnitRunner])
13-
class CallByValueVsCallByNameSuite extends FunSuite {
11+
class CallByValueVsCallByNameSuite extends AnyFunSuite {
1412
test("should call by value") {
1513
var res1: Long = 0
1614
var res2: Long = 0

src/test/scala/com/github/daggerok/DefaultAndNamedArgumentsSuite.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
*/
44
package com.github.daggerok
55

6-
import org.scalatest.FunSuite
76
import org.junit.runner.RunWith
8-
import org.scalatest.junit.JUnitRunner
9-
10-
import scala.annotation.tailrec
7+
import org.scalatest.funsuite.AnyFunSuite
8+
import org.scalatestplus.junit.JUnitRunner
119

1210
@RunWith(classOf[JUnitRunner])
13-
class DefaultAndNamedArgumentsSuite extends FunSuite {
11+
class DefaultAndNamedArgumentsSuite extends AnyFunSuite {
1412

1513
def greeting(name: String = "Anonymous", age: Int = 0) =
1614
s"Hey, My name is: $name, and I'm $age years old!"

src/test/scala/com/github/daggerok/MainSuite.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
*/
44
package com.github.daggerok
55

6-
import org.scalatest.FunSuite
76
import org.junit.runner.RunWith
8-
import org.scalatest.junit.JUnitRunner
7+
import org.scalatest.funsuite.AnyFunSuite
8+
import org.scalatestplus.junit.JUnitRunner
99

1010
@RunWith(classOf[JUnitRunner])
11-
class MainSuite extends FunSuite {
11+
class MainSuite extends AnyFunSuite {
1212
test("Application can be executed") {
1313
Main.main(Array.empty)
1414
}

src/test/scala/com/github/daggerok/StringSuite.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
package com.github.daggerok
55

66
import org.junit.runner.RunWith
7-
import org.scalatest.FunSuite
8-
import org.scalatest.junit.JUnitRunner
7+
import org.scalatest.funsuite.AnyFunSuite
8+
import org.scalatestplus.junit.JUnitRunner
99

1010
@RunWith(classOf[JUnitRunner])
11-
class StringSuite extends FunSuite {
11+
class StringSuite extends AnyFunSuite {
1212
test("scala string should have prepend and append character operation") {
1313
val mid = " n "
1414
val all = 'o' +: mid :+ 'e'

src/test/scala/com/github/daggerok/TailrecSuite.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
*/
44
package com.github.daggerok
55

6-
import org.scalatest.FunSuite
76
import org.junit.runner.RunWith
8-
import org.scalatest.junit.JUnitRunner
7+
import org.scalatest.funsuite.AnyFunSuite
8+
import org.scalatestplus.junit.JUnitRunner
99

1010
import scala.annotation.tailrec
1111

1212
@RunWith(classOf[JUnitRunner])
13-
class TailrecSuite extends FunSuite {
13+
class TailrecSuite extends AnyFunSuite {
1414
test("should concat string n times by using tail recursion") {
1515
@tailrec
1616
def concatTimes(str: String, n: Int, acc: String = ""): String =

0 commit comments

Comments
 (0)