summaryrefslogtreecommitdiff
path: root/test/rexml/xpath/test_base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rexml/xpath/test_base.rb')
-rw-r--r--test/rexml/xpath/test_base.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/rexml/xpath/test_base.rb b/test/rexml/xpath/test_base.rb
index 5a03087ca6d..210d6c7c81a 100644
--- a/test/rexml/xpath/test_base.rb
+++ b/test/rexml/xpath/test_base.rb
@@ -369,11 +369,15 @@ module REXMLTests
assert_equal 2, c
end
+ def match(xpath)
+ XPath.match(@@doc, xpath).collect(&:to_s)
+ end
+
def test_grouping
- t = XPath.first( @@doc, "a/d/*[name()='d' and (name()='f' or name()='q')]" )
- assert_nil t
- t = XPath.first( @@doc, "a/d/*[(name()='d' and name()='f') or name()='q']" )
- assert_equal 'q', t.name
+ assert_equal([],
+ match("a/d/*[name()='d' and (name()='f' or name()='q')]"))
+ assert_equal(["<q id='19'/>"],
+ match("a/d/*[(name()='d' and name()='f') or name()='q']"))
end
def test_preceding