typelevel/jawn

Fix flaky integer parsing test

travisbrown opened this issue · 0 comments

ParseLongCheck's "safe parser fails on invalid input" property occasionally fails because it expects Jawn's parseLong to match Java's Long parsing, but Java's accepts e.g. Tibetan numerals, where Jawn's does not (as the JSON spec requires):

scala> "1༩".toLong
res0: Long = 19

scala> java.lang.Long.parseLong("1༩")
res1: Long = 19

scala> org.typelevel.jawn.util.parseLong("1༩")
org.typelevel.jawn.util.InvalidLong: For input string '1༩'
  at org.typelevel.jawn.util.InvalidLong$.apply(InvalidLong.scala:6)
  at org.typelevel.jawn.util.package$.parseLong(package.scala:43)
  ... 36 elided

This caused a failure in #161. It's clearly only a problem with the test, so I'm just restarting that build, but eventually we'll want to fix it.