Skip to content

Commit

Permalink
Merge pull request #486 from cquiroz/scala-update
Browse files Browse the repository at this point in the history
Update scala versions
  • Loading branch information
cquiroz authored Aug 26, 2021
2 parents 33ce686 + a9c12ca commit e2b1299
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v3
- name: Set up JDK 1.8
uses: olafurpg/setup-scala@v10
uses: olafurpg/setup-scala@v12
with:
java-version: 1.8
- name: Run tests
Expand Down
6 changes: 3 additions & 3 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import com.typesafe.sbt.osgi.SbtOsgi
import com.typesafe.sbt.osgi.SbtOsgi.autoImport._

object Versions {
val Scala = "3.0.0-RC3"
val Scala = "3.0.1"
val ScalaCross =
Seq("2.12.13", "2.13.5", "3.0.0-RC3")
Seq("2.12.13", "2.13.6", Scala)

val ScalaTest = "3.2.8"
val ScalaTest = "3.2.9"
val ScalaCheck = "1.15.4"
}

Expand Down
26 changes: 13 additions & 13 deletions shared/src/test/scala/squants/QuantitySpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ class QuantitySpec extends AnyFlatSpec with Matchers with CustomMatchers with Tr

implicit object ThingeeNumeric extends AbstractQuantityNumeric[Thingee](Thangs)

behavior of "Quantity as implemented in Thingee"
// behavior of "Quantity as implemented in Thingee"

it should "create values using arbitrary numeric types" in {
// define Numeric for each type
abstract class BaseNumeric[T] extends Numeric[T] {
def plus(x: T, y: T) = x + y
def minus(x: T, y: T) = x - y
def times(x: T, y: T) = x * y
def negate(x: T) = -x
def toInt(x: T) = x.toInt
def toLong(x: T) = x.toLong
def toFloat(x: T) = x.toFloat
def compare(x: T, y: T) = if (x == y) 0 else if (x.toDouble > y.toDouble) 1 else -1
}
// define Numeric for each type
abstract class BaseNumeric[T] extends Numeric[T] {
def plus(x: T, y: T) = x + y
def minus(x: T, y: T) = x - y
def times(x: T, y: T) = x * y
def negate(x: T) = -x
def toInt(x: T) = x.toInt
def toLong(x: T) = x.toLong
def toFloat(x: T) = x.toFloat
def compare(x: T, y: T) = if (x == y) 0 else if (x.toDouble > y.toDouble) 1 else -1
}

it should "create values using arbitrary numeric types" in {
implicit val stringNumeric = new BaseNumeric[String] {
def fromInt(x: Int) = x.toString
def toDouble(x: String) = augmentString(x).toDouble // augmentString is used to disambiguate implicit conversion
Expand Down

0 comments on commit e2b1299

Please sign in to comment.