You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running the following invalid attribute search, properly throws an
IllegalArgumentException.
scala> <x/> \ "@"
java.lang.IllegalArgumentException: @
scala> <x/> \@ ""
java.lang.IllegalArgumentException: @
There's no such thing as an empty attribute.
However, when the improper matching value is used against more than
just one element, no error is thrown, just an empty NodeSeq is
returned:
scala> <x><y/><z/></x>.child \ "@"
res1: scala.xml.NodeSeq = NodeSeq()
It should be a failure.
Similarly, the attribute search method, is similarly affected.
scala> <x><y/><z/></x>.child \@ ""
res1: scala.xml.NodeSeq = NodeSeq()
This was identified while writing ScalaCheck property tests.
0 commit comments