File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
src/test/scala/io.github.jonas.circe.config Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ releaseProcess := {
39
39
}
40
40
41
41
val Versions = new {
42
- val circe = " 0.7 .0"
42
+ val circe = " 0.8 .0"
43
43
val config = " 1.3.1"
44
44
val discipline = " 0.8"
45
45
val scalaCheck = " 0.13.5"
@@ -61,7 +61,7 @@ autoAPIMappings := true
61
61
doctestTestFramework := DoctestTestFramework .ScalaTest
62
62
doctestMarkdownEnabled := true
63
63
doctestWithDependencies := false
64
- scalacOptions in (Compile ,doc) := Seq (
64
+ scalacOptions in (Compile , doc) := Seq (
65
65
" -groups" ,
66
66
" -implicits" ,
67
67
" -doc-source-url" , scmInfo.value.get.browseUrl + " /tree/master€{FILE_PATH}.scala" ,
Original file line number Diff line number Diff line change @@ -18,11 +18,18 @@ class CirceConfigLaws extends FlatSpec {
18
18
.mapObject(_.filterKeys(_.nonEmpty).withJsons(normalize))
19
19
.mapArray(_.map(normalize))
20
20
.mapNumber(number => {
21
+ def numberToDouble = {
22
+ val double = number.toDouble
23
+ if (double.isWhole)
24
+ Some (Json .fromLong(double.toLong))
25
+ else
26
+ Json .fromDouble(double)
27
+ }
21
28
// Map to the three principal types supported by Typesafe Config: Int, Long or Double
22
29
val json =
23
30
number.toInt.map(Json .fromInt) orElse
24
31
number.toLong.map(Json .fromLong) orElse
25
- Json .fromDouble(number.toDouble) getOrElse
32
+ numberToDouble getOrElse
26
33
Json .fromInt(42 )
27
34
28
35
json.asNumber.get
You can’t perform that action at this time.
0 commit comments