Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should always error on \("@") #249

Closed
ashawley opened this issue Aug 16, 2018 · 0 comments
Closed

Should always error on \("@") #249

ashawley opened this issue Aug 16, 2018 · 0 comments

Comments

@ashawley
Copy link
Member

Running the following invalid attribute search, properly throws an IllegalArgumentException.

scala> <x/> \ "@"
java.lang.IllegalArgumentException: @

An empty attribute doesn't exist, so it rightly should be a failure.

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()

This was identified while writing ScalaCheck property tests in #110.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant