我想用Specs2測試Json,但我總是得到一個解析錯誤。在Scala中測試JSON與spec2
也許是因爲我使用JObect?
val j: JObject = "hello" -> "world"
j must */("hello")
這是錯誤:
Search_fields
Could not parse:
JObject(List(JField(hello,JString(world))))
java.lang.Exception: Could not parse:
JObject(List(JField(hello,JString(world))))
at net.liftweb.echidnasearch.QuerySearchSpec$$anonfun$1$$anonfun$apply$124.apply(QuerySearchSpec.scala:496)
at net.liftweb.echidnasearch.QuerySearchSpec$$anonfun$1$$anonfun$apply$124.apply(QuerySearchSpec.scala:485)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
MatchQuery
感謝
這是編譯時錯誤還是運行時(spec2)?請粘貼完整的例外。 – VasyaNovikov
謝謝@VasyaNovikov異常更新 – YoBre
再次,這是一個編譯錯誤,還是一個運行時? – VasyaNovikov