WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

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

@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