Commit 994f1c4
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 f3841aa commit 994f1c4
File tree
2 files changed
+20
-0
lines changed2 files changed
+20
-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 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
157 | 176 | | |
0 commit comments