Closed
Description
Trying to match the empty string on descendants (or self) throws an unexpected error:
scala> <x/> \\ ""
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(String.java:646)
at scala.collection.immutable.StringOps$.apply$extension(StringOps.scala:37)
at scala.xml.NodeSeq.$bslash$bslash(NodeSeq.scala:147)
...
The error should be consistent with what is thrown when trying to match the empty string on just children:
scala> <x/> \ ""
java.lang.IllegalArgumentException
at scala.xml.NodeSeq.fail$1(NodeSeq.scala:97)
at scala.xml.NodeSeq.$bslash(NodeSeq.scala:120)
...
This was identified while writing ScalaCheck property tests in #110.
Metadata
Metadata
Assignees
Labels
No labels