JsonMatchers Int treated as Double

已查看 11 次
跳至第一个未读帖子

Nimrod Argov

未读,
2015年2月25日 08:08:462015/2/25
收件人 specs2...@googlegroups.com
Hi,

We've just upgraded to 2.4.11, and the following test fails (also tested with 2.4.15):

class JsonMatchersTest extends Specification with JsonMatchers{
"A JsonMatcher" should {
"Read an Int as an Int" in {
"""{"value":5}""" must /("value" -> 5)
}
}
}

The error is:

{value:5.0} doesn't contain 'value':'5'

Seems that all numbers are read as doubles, even if they have no decimal point.

etorreborre

未读,
2015年2月25日 16:58:212015/2/25
收件人 specs2...@googlegroups.com
That's a bug occurring after the JsonMatchers refactoring, sorry.

It is fixed in 2.4.17-SNAPSHOT, thanks for confirming it works for you.

Eric.

Nimrod Argov

未读,
2015年2月26日 01:59:442015/2/26
收件人 specs2...@googlegroups.com
Great, thanks, I'll try it out.
Also, I was wondering, it seems that the implementation is based on the scala json library, which I understand is to be removed in 2.12.
Do you know if this is true, and if so, are you planning to rewrite it?

Thanks again,

Nimrod

--
You received this message because you are subscribed to a topic in the Google Groups "specs2-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/specs2-users/7z1_UaDMRGA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to specs2-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Nimrod Argov
Software Developer

40 Hanamal street, Tel Aviv, Israel


etorreborre

未读,
2015年2月26日 06:34:552015/2/26
收件人 specs2...@googlegroups.com
I have inlined those classes in specs2 3.0 to avoid compatibility issues in the future.

Eric.


On Thursday, February 26, 2015 at 5:59:44 PM UTC+11, Nimrod Argov wrote:
Great, thanks, I'll try it out.
Also, I was wondering, it seems that the implementation is based on the scala json library, which I understand is to be removed in 2.12.
Do you know if this is true, and if so, are you planning to rewrite it?

Thanks again,

Nimrod
On Wed, Feb 25, 2015 at 11:58 PM, etorreborre <etorr...@gmail.com> wrote:
That's a bug occurring after the JsonMatchers refactoring, sorry.

It is fixed in 2.4.17-SNAPSHOT, thanks for confirming it works for you.

Eric.


On Thursday, February 26, 2015 at 12:08:46 AM UTC+11, Nimrod Argov wrote:
Hi,

We've just upgraded to 2.4.11, and the following test fails (also tested with 2.4.15):

class JsonMatchersTest extends Specification with JsonMatchers{
"A JsonMatcher" should {
"Read an Int as an Int" in {
"""{"value":5}""" must /("value" -> 5)
}
}
}

The error is:

{value:5.0} doesn't contain 'value':'5'

Seems that all numbers are read as doubles, even if they have no decimal point.

--
You received this message because you are subscribed to a topic in the Google Groups "specs2-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/specs2-users/7z1_UaDMRGA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to specs2-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
回复全部
回复作者
转发
0 个新帖子