aboutsummaryrefslogtreecommitdiffstats
path: root/test/rexml
Commit message (Collapse)AuthorAgeFilesLines
* Import REXML 3.2.3 (#2548)Sutou Kouhei2019-10-121-0/+6
|
* [ruby/rexml] xpath: add missing value conversions for equality and ↵Kouhei Sutou2019-08-042-84/+256
| | | | | | | | | | relational expressions GitHub: fix #18 Reported by Mirko Budszuhn. Thanks!!! https://github.com/ruby/rexml/commit/0dca2a2ba0
* [ruby/rexml] xpath number: fix a bug that false is converted to NaNKouhei Sutou2019-08-041-25/+28
| | | | | | | | | | GitHub: fix #18 It must be 0. Reported by Mirko Budszuhn. Thanks!!! https://github.com/ruby/rexml/commit/b48f3afa3b
* [ruby/rexml] xpath local_name: fix a bug that nil is returned for ↵Kouhei Sutou2019-08-044-0/+45
| | | | | | | | nonexistent case It must be an empty string. https://github.com/ruby/rexml/commit/81bc7cd4f5
* [ruby/rexml] xpath boolean: implementKouhei Sutou2019-08-041-0/+75
| | | | https://github.com/ruby/rexml/commit/feb8ddb1ec
* [ruby/rexml] xpath: fix a bug for equality or relational expressionsKouhei Sutou2019-08-042-4/+92
| | | | | | | | | | | GitHub: fix #17 There is a bug when they are used against node set. They should return boolean value but they returned node set. Reported by Mirko Budszuhn. Thanks!!! https://github.com/ruby/rexml/commit/a02bf38440
* [ruby/rexml] Message less confusing error to human (#16)ujihisa2019-08-041-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | * Message less confusing error to human * Problem: Following error message is not helpful, because you have to reason that '' actually means it's in the top-level, and the 'div' (not '</div>') is an end tag require "rexml/parsers/lightparser" REXML::Parsers::LightParser.new('</div>').parse #=> Missing end tag for '' (got 'div') * Solution: add a special case in error handling just to change the error message require "rexml/parsers/lightparser" REXML::Parsers::LightParser.new('</div>').parse #=> Unexpected top-level end tag (got 'div') * Refactor by removing unnecessary `md` check * Thanks @a_matsuda to review this at asakusa.rb! https://github.com/ruby/rexml/commit/f6528d4477
* [ruby/rexml] test: compare with real elementKouhei Sutou2019-08-041-2/+5
| | | | https://github.com/ruby/rexml/commit/9f2908de2e
* [ruby/rexml] Fix crash with nil XPath variables (#13)Alyssa Ross2019-08-041-0/+19
| | | | | Patch by Alyssa Ross. Thanks!!! https://github.com/ruby/rexml/commit/2a53c54f58
* [ruby/rexml] Fix attribute's default namespace behaviorKouhei Sutou2019-08-041-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: It's a backward incompatible change. If we have any serious problems with this change, we may revert this change. The XML namespace specification says the default namespace doesn't apply to attribute names but it does in REXML without this change: https://www.w3.org/TR/xml-names/#uniqAttrs > the default namespace does not apply to attribute names REXML reports a parse error for the following XML that is described as a valid XML in the XML nsmaspace specification without this change: <!-- http://www.w3.org is bound to n1 and is the default --> <x xmlns:n1="http://www.w3.org" xmlns="http://www.w3.org" > <good a="1" b="2" /> <good a="1" n1:a="2" /> </x> If attribute doesn't have prefix, the attribute should return "" for both #prefix and #namespace. https://github.com/ruby/rexml/commit/9e4fd552bc
* [ruby/rexml] xpath: fix a bug that no namespace attribute isn't matched with ↵Kouhei Sutou2019-08-041-1/+9
| | | | | | | | | | prefix [ruby-list:50733] Reported by Yasuhiro KIMURA. Thanks!!! https://github.com/ruby/rexml/commit/8f3c5c176a
* Really ensure loading REXML in testskou2018-12-201-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Ensure loading REXMLkou2018-12-201-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: upgrade to 3.1.8kou2018-12-2013-56/+275
| | | | | | | | | See https://github.com/ruby/rexml/blob/master/NEWS.md for change summary. Changes for spec/ has been reported: https://github.com/ruby/spec/pull/639 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: disable XPath 1.0 compatible "#{ELEMENT_NAME}" processing by defaultkou2018-04-283-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | It breaks backward compatibility than I thought. So it's disabled by default. It means that REXML's XPath processor isn't compatible with XPath 1.0. But it will be acceptable for users. We can enable it by specifying "strict: true" to REXML::XPathParser.new explicitly. * lib/rexml/xpath.rb, lib/rexml/xpath_parser.rb: Accept "strict: true" option. * test/rexml/test_contrib.rb, test/rexml/xpath/test_base.rb: Use not XPath 1.0 compatible behavior. * test/rexml/test_jaxen.rb: Use XPath 1.0 compatible behavior. * test/rss/test_1.0.rb, test/rss/test_dublincore.rb, spec/ruby/library/rexml/element/namespace_spec.rb, spec/ruby/library/rexml/element/namespaces_spec.rb, spec/ruby/library/rexml/element/prefixes_spec.rb: Enable again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix XPath bug of //#{ELEMENT_NAME}[#{POSITION}]kou2018-04-222-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The position should be counted for each nodeset but the previous implementation counts position for union-ed nodeset. For example, "/a/*/*[1]" should be matched to "<c1/>" and "<c2/>" with the following XML. <a> <b> <c1/> </b> <b> <c2/> </b> </a> But the previous implementation just returns only "<c1/>". * lib/rexml/element.rb (REXML::Attributes#each_attribute): Support Enumerator for no block use. * lib/rexml/element.rb (REXML::Attributes#each): Support Enumerator for no block use. * lib/rexml/functions.rb (REXML::Functions.string): Support NaN again. * lib/rexml/xpath_parser.rb: Re-implement "Step" evaluator. It should evaluate "AxisSpecifier", "NodeTest" and "Predicate" in one step to respect position for each nodeset. * test/rexml/test_jaxen.rb: Enable more tests. Remained tests should be also enabled but it'll not be near future. * test/rexml/xpath/test_base.rb: Fix expected value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix XPath bug of /#{ELEMENT_NAME}kou2018-04-224-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't mean that all elements which name "ELEMENT_NAME" with any namespace URI including null namespace URI. It means that all elements which name "ELEMENT_NAME" with null namespace URI. https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-NodeTest > if the QName does not have a prefix, then the namespace URI is null > (this is the same way attribute names are expanded). We need to use "*[local-name()='#{ELEMENT_NAME}']" for all elements which name "ELEMENT_NAME" with any namespace URI including null namespace URI in XPath 1.0. But it's inconvenient. So this change includes "*:#{LOCAL_NAME}" syntax support that is introduced since XPath 2.0. * lib/rexml/parsers/xpathparser.rb: Support "*:#{LOCAL_NAME}" syntax that is introduced since XPath 2.0. * lib/rexml/xpath_parser.rb: * Fix namespace URI processing for "#{ELEMENT_NAME}". Now, "#{ELEMENT_NAME}" doesn't accept elements with null namespace URI. * Add "*:#{LOCAL_NAME}" support. * test/rexml/test_contrib.rb, test/rexml/test_core.rb, test/rexml/xpath/test_base.rb: Follow this change. * test/rexml/test_jaxen.rb: Fix namespace processing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Enable more testskou2018-04-211-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix XPath concat() implementationkou2018-04-211-1/+1
| | | | | | | | | * lib/rexml/functions.rb (REXML::Functions.concat): Implement. * test/rexml/test_jaxen.rb: Enable one more test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix XPath string() implementationkou2018-04-211-22/+5
| | | | | | | | | | | | | * lib/rexml/functions.rb( REXML::Functions.string): * Support context node. * Fix implementation for document node to remove out of root nodes. * Support processing instruction node. * Improve implementation for integer to omit decimals. * test/rexml/test_jaxen.rb: Enable processing instruction test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Make more readablekou2018-04-211-2/+2
| | | | | | | test/rexml/test_jaxen.rb: Use more meaningful name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix a test bugkou2018-04-211-1/+1
| | | | | | | | test/rexml/test_jaxen.rb: Fix wrong assert_raise usage. Note that this code isn't used yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Make more readablekou2018-04-211-1/+6
| | | | | | | test/rexml/xpath/test_base.rb: Use here document for readability. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix a XPath bug that white spaces aren't ignoredkou2018-04-191-22/+29
| | | | | | | | | | | lib/rexml/parsers/xpathparser.rb: Ignore white spaces in relative location path. test/rexml/xpath/test_base.rb: Add more test patterns and use more debug friendly assertion style. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix wrong assertionkou2018-04-191-1/+1
| | | | | | | test/rexml/xpath/test_base.rb: Use constant value for the expected value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Use more debug friendly assertion stylekou2018-04-191-5/+3
| | | | | | | | test/rexml/xpath/test_base.rb: Expand loop assertion and stop to checking just the first value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Use more debug friendly assertion stylekou2018-04-191-5/+4
| | | | | | | | test/rexml/xpath/test_base.rb: Stop to use separated assertions for checking array value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Make more readablekou2018-04-191-6/+25
| | | | | | | test/rexml/xpath/test_base.rb: Use here document for XML. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix a XPath bug of /child::node()kou2018-04-041-10/+17
| | | | | | | | | | | | [Bug #14600] * lib/rexml/xpath_parser.rb: Fix a bug that "/child::node()" returns XML declaration and text nodes out of root element. * test/rexml/test_jaxen.rb: Enable more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix a XPath bug of @attribute/parentkou2018-04-041-5/+5
| | | | | | | | | | | | [Bug #14600] * lib/rexml/functions.rb: Fix a bug that "@attribute/parent" doesn't return element of its attribute. * test/rexml/test_jaxen.rb: Enable more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix a XPath bug of name(node-set)kou2018-04-031-17/+25
| | | | | | | | | | | | [Bug #14600] * lib/rexml/functions.rb: Fix a bug that "name(node-set)" returns element instead of element name. * test/rexml/test_jaxen.rb: Enable more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Start re-enabling Jaxen testskou2018-04-011-94/+92
| | | | | | | | | | | | | [Bug #14600] Reported by MSP-Greg. Thanks!!! * lib/rexml/xpath_parser.rb: Fix a bug that "following_siblings::*[N]" doesn't work. * test/rexml/test_jaxen.rb: Enable only axis test for now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Rename test classes to allow stable test count when running test-all -jnobu2018-03-131-1/+1
| | | | | | | | [Fix GH-1763] From: MSP-Greg <MSP-Greg@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* REXML: Fix a bug that unexpected methods can be called as a XPath functionkou2017-08-131-0/+13
| | | | | | | | | [HackerOne:249295] Reported by Andrea Jegher. Thanks!!! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: add close tag check on end of document to StreamParserkou2017-06-071-0/+32
| | | | | | | | | [ruby-core:81593] [Bug #13636] Reported by Anton Sivakov. Thanks!!! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: REXML::Element#[] accepts String or Symbol as attribute namekou2016-12-061-0/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix tests depending on sort stabilitynobu2016-10-131-1/+3
| | | | | | | | * test/rexml/xpath/test_text.rb (test_ancestors): Array#sort may not be stable. [ruby-core:76088] [Bug #12509] * test/rss/test_maker_{0.9,1.0,2.0}.rb (test_items): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* better assertionnobu2016-10-121-1/+1
| | | | | | | * test/rexml/xpath/test_text.rb (test_ancestors): use assert_kind_of for better assertion message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use Integer instead of Fixnum and Bignum.akr2016-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c, lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb, lib/rubygems/specification.rb, lib/uri/generic.rb, bootstraptest/test_eval.rb, basictest/test.rb, test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb, test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb, test/csv/test_data_converters.rb, test/date/test_date.rb, test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb, test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb, test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb, test/ruby/test_bignum.rb, test/ruby/test_case.rb, test/ruby/test_class.rb, test/ruby/test_complex.rb, test/ruby/test_enum.rb, test/ruby/test_eval.rb, test/ruby/test_iseq.rb, test/ruby/test_literal.rb, test/ruby/test_math.rb, test/ruby/test_module.rb, test/ruby/test_numeric.rb, test/ruby/test_range.rb, test/ruby/test_rational.rb, test/ruby/test_refinement.rb, test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb, test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb, test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix common misspelling [ci skip]nobu2015-12-241-1/+1
| | | | | | | * compile.c, cont.c, doc, man: fix common misspelling. [ruby-core:72466] [Bug #11870] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-1642-0/+42
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use assert_raisenobu2015-06-022-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/rexml/test_document.rb: Indent.kou2014-11-151-56/+56
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/rexml/test_document.rbkou2014-11-151-5/+9
| | | | | | | | (REXMLTests::TestDocument::EntityExpansionLimitTest): Group tests by general entity and parameter entity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/rexml/test_document.rbkou2014-11-151-65/+65
| | | | | | | | | (REXMLTests::TestDocument::EntityExpansionLimitTest): Define test XML in each test method because (1) each XML in used only one test and (2) related data and code should be close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/rexml/test_document.rbkou2014-11-151-2/+8
| | | | | | | | (REXMLTests::TestDocument::EntityExpansionLimitTest): Use one test method for one test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/rexml/test_document.rbkou2014-11-151-4/+8
| | | | | | | | (REXMLTests::TestDocument::EntityExpansionLimitTest): Use setup and teardown instead of ensure in test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/rexml/test_document.rbkou2014-11-151-58/+58
| | | | | | | (REXMLTests::TestDocument::EntityExpansionLimitTest): Indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/rexml/test_document.rb (REXMLTests::TestDocument): Groupkou2014-11-151-0/+2
| | | | | | | entity expansion limit related tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/rexml/test_document.rb (REXMLTests::TestDocument::BomTest):kou2014-11-151-1/+1
| | | | | | | | Fix wrong parent class. It doesn't need inherit tests in TestDocument class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e