Commit e3811d4
committed
Fix failure for empty attribute match
Running the following invalid attribute search, properly throws an
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.
This was identified while writing ScalaCheck property tests.1 parent 7e8a496 commit e3811d4
File tree
2 files changed
+10
-0
lines changed2 files changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
157 | 166 | | |
0 commit comments