diff options
Diffstat (limited to 'src/test/scala/cc/spray/json/BasicFormatsSpec.scala')
-rw-r--r-- | src/test/scala/cc/spray/json/BasicFormatsSpec.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/scala/cc/spray/json/BasicFormatsSpec.scala b/src/test/scala/cc/spray/json/BasicFormatsSpec.scala index 7f74e37..11576a4 100644 --- a/src/test/scala/cc/spray/json/BasicFormatsSpec.scala +++ b/src/test/scala/cc/spray/json/BasicFormatsSpec.scala @@ -38,6 +38,9 @@ class BasicFormatsSpec extends Specification with DefaultJsonProtocol { "convert a JsNumber to a Float" in { JsNumber(4.2f).fromJson[Float] mustEqual 4.2f } + "convert a JsNull to a Float" in { + JsNull.fromJson[Float].isNaN mustEqual Float.NaN.isNaN + } } "The DoubleJsonFormat" should { @@ -56,6 +59,9 @@ class BasicFormatsSpec extends Specification with DefaultJsonProtocol { "convert a JsNumber to a Double" in { JsNumber(4.2).fromJson[Double] mustEqual 4.2 } + "convert a JsNull to a Double" in { + JsNull.fromJson[Double].isNaN mustEqual Double.NaN.isNaN + } } "The ByteJsonFormat" should { |