summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2018-04-22rexml: Fix XPath bug of //#{ELEMENT_NAME}[#{POSITION}]kou
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
2018-04-22rexml: Fix XPath bug of /#{ELEMENT_NAME}kou
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
2018-04-21test/ruby/test_io.rb: try to diagnose stuck test_recycled_fd_closenormal
I can't reproduce the problem myself, but gets loop seems ought to give more useful information for tracking down where we're stuck, at least. Followup-to: r63217 cf. http://ci.rvm.jp/results/trunk-test@frontier/804284 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21test_jit.rb: follow the change of instructionk0kubun
in r63225. Not strictly needed but to avoid confusion. The JIT compiler itself seems working fine. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21rexml: Enable more testskou
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-21rexml: Fix XPath concat() implementationkou
* 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
2018-04-21rexml: Fix XPath string() implementationkou
* 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
2018-04-21rexml: Make more readablekou
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
2018-04-21rexml: Fix a test bugkou
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
2018-04-21rexml: Make more readablekou
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
2018-04-21test/ruby/test_io.rb: add closing recycled FD testnormal
Followup-to: r63216 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-20_mjit_compile_send.erb: inline attr_reader callk0kubun
_mjit_compile_send_guard.erb: carve out the shared logic to invalidate inlined method call common.mk: update dependency for this change test_jit.rb: add test for attr_reader optimization * Benchmark ``` require 'benchmark_driver' Benchmark.driver do |x| x.prelude %{ class C attr_reader :a def initialize @a = 1 end end o = C.new def l o i = 0 while i < 1000000 o.a i += 1 end end } x.report 'aread', %{ l o } x.loop_count 1000 x.rbenv 'before', 'before,--jit', 'after,--jit' x.verbose end ``` ``` before: ruby 2.6.0dev (2018-04-20 trunk 63211) [x86_64-linux] before,--jit: ruby 2.6.0dev (2018-04-20 trunk 63211) +JIT [x86_64-linux] after,--jit: ruby 2.6.0dev (2018-04-20 trunk 63211) +JIT [x86_64-linux] last_commit=_mjit_compile_send.erb: inline attr_reader call Calculating ------------------------------------- before before,--jit after,--jit aread 54.597 122.894 218.574 i/s - 1.000k times in 18.316102s 8.137089s 4.575106s Comparison: aread after,--jit: 218.6 i/s before,--jit: 122.9 i/s - 1.78x slower before: 54.6 i/s - 4.00x slower ``` * Optcarrot A little made faster? fps: 71.35 -> 72.11 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-20variable.c: fix thread + fork errors in autoloadnormal
This is fairly non-intrusive bugfix to prevent children from trying to reach into thread stacks of the parent. I will probably reuse this idea and redo r62934, too (same bug). * vm_core.h (typedef struct rb_vm_struct): add fork_gen counter * thread.c (rb_thread_atfork_internal): increment fork_gen * variable.c (struct autoload_data_i): store fork_gen * variable.c (check_autoload_data): remove (replaced with get_...) * variable.c (get_autoload_data): check fork_gen when retrieving * variable.c (check_autoload_required): use get_autoload_data * variable.c (rb_autoloading_value): ditto * variable.c (rb_autoload_p): ditto * variable.c (current_autoload_data): ditto * variable.c (autoload_reset): reset fork_gen, adjust indent * variable.c (rb_autoload_load): set fork_gen when setting state * test/ruby/test_autoload.rb (test_autoload_fork): new test [ruby-core:86410] [Bug #14634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-20range.c: step in bignumnobu
* range.c (range_step): honor step in bignum addition. [Feature #12912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-20range.c: fix fixnum loop conditionnobu
* range.c (range_step): FIXABLE + FIXABLE never overflow, but may not be FIXABLE. [Feature #12912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-19fiddle/test_import.rb: fix warnings by rubygemsnobu
[Bug #14686] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-19fiddle/import.rb: suppress warningnobu
* ext/fiddle/lib/fiddle/import.rb: suppress exception report when $DEBUG is enabled. [ruby-core:86536] [Bug #14686] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-19rexml: Fix a XPath bug that white spaces aren't ignoredkou
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
2018-04-19rexml: Fix wrong assertionkou
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
2018-04-19rexml: Use more debug friendly assertion stylekou
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
2018-04-19rexml: Use more debug friendly assertion stylekou
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
2018-04-19rexml: Make more readablekou
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
2018-04-19range.c: Make Range#bsearch support endless rangesmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-19Make Range#min, max, include?, cover?, and === to support endless rangemame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-19Introduce endless range [Feature#12912]mame
Typical usages: ``` p ary[1..] # drop the first element; identical to ary[1..-1] (1..).each {|n|...} # iterate forever from 1; identical to 1.step{...} ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-19dir.c: warning for NULnobu
* dir.c (rb_push_glob): warn NUL-separated glob patterns. [Feature #14643] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-19Add slice method to ENV like Hash#slicenobu
[Feature #14559] From: Benoit Tigeot <benoit@hopsandfork.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17test/ruby/test_super.rb: Remove unused assertionsmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17The test for TracePoint with thread had never worked correctlymame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17The test for TracePoint#raised_exception had never worked correctlymame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17Remove the old disabled assertions for 1.8/1.9mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17Enable the assertions that had been disabled for historical reasonmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17Remove the assertions that have no meaningmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17Remove the disabled old tests for Ruby 1.8/1.9 feature changemame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17Use assert(false) for the path that is expected unreachablemame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17test/date/test_date_base.rb: removedmame
It depends upon calendar.so which is not bundled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17test/csv/test_features.rb: enable accidentally-disabled assertionsmame
CSV.new does not yield the instance. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17test/zlib/test_zlib.rb (test_path): enable the accidentally-disabled assertionmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-17parse.y: fix cmdarg in command_argsnobu
* parse.y (call_args): fix invalid CMDARG state after command_args followed by tLBRACE_ARG. [ruby-core:86551] [Bug #14690] From: Ilya Bylich <ibylich@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-16compile.c: align rangenobu
* compile.c (ibf_dump_object_struct): align range elements. [ruby-core:86548] [Bug #14689] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-16string.c: fix dumped suffixnobu
* string.c (rb_str_dump): get rid of an error on evaling with frozen-string-literal enabled. [ruby-core:86539] [Bug #14687] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-16string.c: fix checking ordernobu
* string.c (str_undump): check for suffix before if Unicode escape conflicts with it. the message "but used force_encoding" sounds strange when it is not used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-14Extend timeoutnaruse
On armv7 environment, the timeout is too short http://rubyci.s3.amazonaws.com/scw-9d6766/ruby-trunk/log/20180319T191706Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-14irb.rb: restore the last errornobu
* lib/irb.rb (eval_input): restore the last error `$!`, as the previous result. [Feature #14684] * lib/irb/context.rb (evaluate): add `exception` keyword argument to set the last error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-14irb/{context,workspace}.rb: use local_variable_setnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-13file.c: chardev is loadablenobu
* file.c (ruby_is_fd_loadable): allow character devices to load, e.g., `ruby /dev/null` exits successfully. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-12parse.y: `when` indentnobu
* parse.y (k_when): warn less-indented `when` than `case`. [ruby-core:86492] [Bug #14674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-12assert indents of `case` and `end`nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-12error.c: super in method_missingnobu
* error.c (nometh_err_initialize): do not shirtcut rb_call_super, to push proper control frame. [ruby-dev:50522] [Bug #14670] * error.c (rb_nomethod_err_new): allocate and initialize a new NoMethodError instance. * vm_eval.c (rb_make_no_method_exception): create a new exception instance directly without method calls, to prevent influence of ruby level method definitions, which can cause an unpredictable behavior, e.g., infinite recursion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-12marshaltestlib.rb: use clean object for exceptionnobu
* test/ruby/marshaltestlib.rb (test_exception): use separate clean object to raise an exception. TestCase instance often has modules included. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e