Skip to content

Commit

Permalink
Update scala 2.13.0 to 2.13.4 (#141)
Browse files Browse the repository at this point in the history
* Extend scala.annotation.Annotation

* Supply empty argument list explicitly

* Update scala 2.13.0 to 2.13.4

* Update sbt-scoverage to 1.6.1

* Add test for issue #82
  • Loading branch information
Philippus authored Jun 22, 2021
1 parent d8000fd commit e82a37a
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ scala:
- 2.10.7
- 2.11.12
- 2.12.8
- 2.13.0
- 2.13.4
jdk:
- oraclejdk8
- openjdk8
Expand Down
10 changes: 9 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ lazy val project = Project("project", file("."))
description := "A Scala-friendly wrapper companion for Typesafe config",
startYear := Some(2013),
scalaVersion := "2.12.14",
crossScalaVersions := Seq("2.10.7", "2.11.12", scalaVersion.value, "2.13.0"),
crossScalaVersions := Seq("2.10.7", "2.11.12", scalaVersion.value, "2.13.4"),
scalacOptions ++= Seq(
"-feature",
"-deprecation",
Expand All @@ -38,6 +38,14 @@ lazy val project = Project("project", file("."))
}
}
},
unmanagedSourceDirectories in Test ++= {
(unmanagedSourceDirectories in Test).value.map { dir =>
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => file(dir.getPath ++ "-2.13+")
case _ => file(dir.getPath ++ "-2.13-")
}
}
},
libraryDependencies ++=
(if (scalaVersion.value.startsWith("2.10"))
Seq(
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resolvers += "Typesafe Repository" at "https://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")

addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.7")

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala-2.13+/macrocompat/bundle.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package macrocompat

class bundle
class bundle extends scala.annotation.Annotation
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trait CollectionReaders {
val entryConfig = entry.atPath(DummyPathValue)
builder += entryReader.read(entryConfig, DummyPathValue)
}
builder.result
builder.result()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ trait CollectionReaders {
val entryConfig = entry.atPath(DummyPathValue)
builder += entryReader.read(entryConfig, DummyPathValue)
}
builder.result
builder.result()
}
}

Expand Down
23 changes: 23 additions & 0 deletions src/test/scala-2.13+/net/ceedubs/ficus/Issue82Spec.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package net.ceedubs.ficus

import net.ceedubs.ficus.Ficus._
import net.ceedubs.ficus.readers.ArbitraryTypeReader._
import com.typesafe.config._
import org.specs2.mutable.Specification

class Issue82Spec extends Specification {
"Ficus config" should {
"not throw `java.lang.ClassCastException`" in {
case class TestSettings(val `foo-bar`: Long, `foo`: String)
val config = ConfigFactory.parseString("""{ foo-bar: 3, foo: "4" }""")
config.as[TestSettings] must not(throwA[java.lang.ClassCastException])
}

"""should not assign "foo-bar" to "foo"""" in {
case class TestSettings(val `foo-bar`: String, `foo`: String)
val config = ConfigFactory.parseString("""{ foo-bar: "foo-bar", foo: "foo" }""")
val settings = config.as[TestSettings]
(settings.`foo-bar` mustEqual "foo-bar") and (settings.`foo` mustEqual "foo")
}
}
}

0 comments on commit e82a37a

Please sign in to comment.