Skip to content
Permalink
Browse files

Updated Scala version and dependencies

  • Loading branch information
kiroco12 committed Nov 20, 2019
1 parent 904ab9e commit 3b2ae008fc8317045e7a7d50c6d8c4f08af31da4
Showing with 217 additions and 246 deletions.
  1. +1 −1 .travis.yml
  2. +7 −4 build.sbt
  3. +19 −12 project/ProjectPlugin.scala
  4. +1 −1 project/build.properties
  5. +2 −2 project/plugins.sbt
  6. +3 −2 src/main/scala/scalatutorial/ScalaTutorial.scala
  7. +3 −2 src/main/scala/scalatutorial/sections/ClassesVsCaseClasses.scala
  8. +3 −2 src/main/scala/scalatutorial/sections/DefinitionsAndEvaluation.scala
  9. +3 −2 src/main/scala/scalatutorial/sections/FunctionalLoops.scala
  10. +4 −4 src/main/scala/scalatutorial/sections/HigherOrderFunctions.scala
  11. +3 −2 src/main/scala/scalatutorial/sections/ImperativeProgramming.scala
  12. +3 −2 src/main/scala/scalatutorial/sections/LazyEvaluation.scala
  13. +3 −2 src/main/scala/scalatutorial/sections/LexicalScopes.scala
  14. +4 −3 src/main/scala/scalatutorial/sections/ObjectOrientedProgramming.scala
  15. +3 −2 src/main/scala/scalatutorial/sections/PolymorphicTypes.scala
  16. +3 −2 src/main/scala/scalatutorial/sections/ScalaTutorialSection.scala
  17. +3 −2 src/main/scala/scalatutorial/sections/StandardLibrary.scala
  18. +3 −2 src/main/scala/scalatutorial/sections/StructuringInformation.scala
  19. +4 −3 src/main/scala/scalatutorial/sections/SyntacticConveniences.scala
  20. +3 −2 src/main/scala/scalatutorial/sections/TailRecursion.scala
  21. +3 −2 src/main/scala/scalatutorial/sections/TermsAndTypes.scala
  22. +3 −2 src/main/scala/scalatutorial/sections/TypeClasses.scala
  23. +3 −2 src/main/scala/scalatutorial/utils/BankAccount.scala
  24. +3 −2 src/main/scala/scalatutorial/utils/IntSet.scala
  25. +3 −2 src/main/scala/scalatutorial/utils/Note.scala
  26. +3 −2 src/main/scala/scalatutorial/utils/Rational.scala
  27. +3 −2 src/main/scala/scalatutorial/utils/animals.scala
  28. +3 −2 src/main/scala/scalatutorial/utils/sorting.scala
  29. +10 −9 src/test/scala/scalatutorial/sections/ClassesVsCaseClassesSpec.scala
  30. +10 −9 src/test/scala/scalatutorial/sections/DefinitionsAndEvaluationSpec.scala
  31. +0 −21 src/test/scala/scalatutorial/sections/FunctionalLoopsSpec.scala
  32. +0 −20 src/test/scala/scalatutorial/sections/HigherOrderFunctionsSpec.scala
  33. +8 −12 src/test/scala/scalatutorial/sections/ImperativeProgrammingSpec.scala
  34. +9 −8 src/test/scala/scalatutorial/sections/LazyEvaluationSpec.scala
  35. +9 −8 src/test/scala/scalatutorial/sections/LexicalScopesSpec.scala
  36. +9 −8 src/test/scala/scalatutorial/sections/ObjectOrientedProgrammingSpec.scala
  37. +8 −7 src/test/scala/scalatutorial/sections/PolymorphicTypesSpec.scala
  38. +9 −8 src/test/scala/scalatutorial/sections/StandardLibrarySpec.scala
  39. +10 −9 src/test/scala/scalatutorial/sections/StructuringInformationSpec.scala
  40. +15 −14 src/test/scala/scalatutorial/sections/SyntacticConveniencesSpec.scala
  41. +0 −20 src/test/scala/scalatutorial/sections/TailRecursionSpec.scala
  42. +10 −13 src/test/scala/scalatutorial/sections/TermsAndTypesSpec.scala
  43. +7 −9 src/test/scala/scalatutorial/sections/TypeClassesSpec.scala
  44. +1 −1 version.sbt
@@ -1,6 +1,6 @@
language: scala
scala:
- 2.11.11
- 2.12.10
jdk:
- openjdk8
script:
@@ -1,4 +1,6 @@
val scalaExercisesV = "0.4.0-SNAPSHOT"
import ProjectPlugin.autoImport._

val scalaExercisesV = "0.5.0-SNAPSHOT"

def dep(artifactId: String) = "org.scala-exercises" %% artifactId % scalaExercisesV

@@ -9,9 +11,10 @@ lazy val `scala-tutorial` = (project in file("."))
libraryDependencies ++= Seq(
dep("exercise-compiler"),
dep("definitions"),
%%("scalatest"),
%%("scalacheck"),
%%("scheckShapeless")
%%("shapeless", V.shapeless),
%%("scalatest", V.scalatest),
%%("scalacheck", V.scalacheck),
"com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % V.scalacheckShapeless
)
)

@@ -1,5 +1,5 @@
import de.heikoseeberger.sbtheader.HeaderPattern
import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport._
import de.heikoseeberger.sbtheader.License._
import sbt.Keys._
import sbt._
import sbtorgpolicies._
@@ -12,6 +12,19 @@ object ProjectPlugin extends AutoPlugin {

override def requires: Plugins = plugins.JvmPlugin && OrgPoliciesPlugin

object autoImport {

lazy val V = new {
val scala212: String = "2.12.10"
val shapeless: String = "2.3.3"
val scalatest: String = "3.0.8"
val scalacheck: String = "1.14.2"
val scalacheckShapeless: String = "1.2.3"
}
}

import autoImport._

override def projectSettings: Seq[Def.Setting[_]] =
Seq(
description := "Scala Exercises: The path to enlightenment",
@@ -25,23 +38,17 @@ object ProjectPlugin extends AutoPlugin {
organizationEmail = "hello@47deg.com"
),
orgLicenseSetting := ApacheLicense,
scalaVersion := "2.11.11",
scalaVersion := V.scala212,
scalaOrganization := "org.scala-lang",
crossScalaVersions := Seq("2.11.11"),
resolvers ++= Seq(
Resolver.mavenLocal,
Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases")
),
scalacOptions := sbtorgpolicies.model.scalacCommonOptions,
headers := Map(
"scala" -> (HeaderPattern.cStyleBlockComment,
s"""|/*
| * scala-exercises - ${name.value}
| * Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
| */
|
|""".stripMargin)
)
headerLicense := Some(Custom(s"""| scala-exercises - ${name.value}
| Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
|
|""".stripMargin))
)
}
@@ -1 +1 @@
sbt.version=0.13.13
sbt.version=1.2.8
@@ -2,5 +2,5 @@ resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots")
)

addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.4.0-SNAPSHOT", "0.13", "2.10")
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.5.13")
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.5.0-SNAPSHOT")
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.12.0-M3")
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -158,10 +159,9 @@ object HigherOrderFunctions extends ScalaTutorialSection {
*/
def tailRecSum(res0: Int, res1: Int): Unit = {
def sum(f: Int => Int, a: Int, b: Int): Int = {
def loop(x: Int, acc: Int): Int = {
def loop(x: Int, acc: Int): Int =
if (x > b) acc
else loop(x + res0, acc + f(x))
}
loop(a, res1)
}
sum(x => x, 1, 10) shouldBe 55
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,11 +1,12 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections

import scalatutorial.utils.{Empty, IntSet, NonEmpty}
import scalatutorial.utils.{Empty, NonEmpty}

/** @param name object_oriented_programming */
object ObjectOrientedProgramming extends ScalaTutorialSection {
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -49,7 +50,7 @@ object SyntacticConveniences extends ScalaTutorialSection {
def tuples(res0: (Int, String)): Unit = {
def pair(i: Int, s: String): (Int, String) = (i, s)

pair(42, "foo") shouldBe (42, "foo")
pair(42, "foo") shouldBe ((42, "foo"))
pair(0, "bar") shouldBe res0
}

@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.utils
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.utils
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.utils
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.utils
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.utils
@@ -1,6 +1,7 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.utils
@@ -1,25 +1,26 @@
/*
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
* scala-exercises - exercises-scalatutorial
* Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
*
*/

package scalatutorial.sections

import org.scalacheck.Shapeless._
import org.scalacheck.ScalacheckShapeless._
import org.scalaexercises.Test
import org.scalatest.Spec
import org.scalatest.prop.Checkers
import org.scalatest.refspec.RefSpec
import org.scalatestplus.scalacheck.Checkers
import shapeless.HNil

class ClassesVsCaseClassesSpec extends Spec with Checkers {
class ClassesVsCaseClassesSpec extends RefSpec with Checkers {

def `check creation and manipulation`: Unit =
def `check creation and manipulation`(): Unit =
check(Test.testSuccess(ClassesVsCaseClasses.creationAndManipulation _, "C" :: HNil))

def `check equality`: Unit =
def `check equality`(): Unit =
check(Test.testSuccess(ClassesVsCaseClasses.equality _, false :: true :: HNil))

def `check encoding`: Unit =
def `check encoding`(): Unit =
check(
Test.testSuccess(
ClassesVsCaseClasses.encoding _,

0 comments on commit 3b2ae00

Please sign in to comment.
You can’t perform that action at this time.