Skip to content

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

Closed
@ashawley

Description

@ashawley

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions