summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/irb] Print deprecation warning for `help` commandHEADmasterStan Lo2023-05-181-12/+26
| | | | | | | | (https://github.com/ruby/irb/pull/567) * Give show_doc its own command class * Print deprecation warning for `help` command
* Move ar_hint to ar_table_structPeter Zhu2023-05-172-1/+4
| | | | This allows Hashes with ST tables to fit int he 80 byte size pool.
* Implement Hash AR tables on VWAPeter Zhu2023-05-172-2/+24
|
* [ruby/irb] Fix Test timedout in test_debug_cmdtomoya ishida2023-05-171-2/+5
| | | | | | | | (https://github.com/ruby/irb/pull/582) * Suppress Reline::IOGate.cursor_pos writing escape sequence in test_debug_cmd * Force use Reline::GeneralIO as Reline::IOGate and remove RUBY_DEBUG_NO_RELINE option for debug test
* [rubygems/rubygems] Bump rb-sysdependabot[bot]2023-05-152-7/+8
| | | | | | | | | | | | | | | Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.75 to 0.9.77. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.75...v0.9.77) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
* Unskip the test skipped in #4173 (#7809)KJ Tsanaktsidis2023-05-151-5/+0
| | | | | | | | | | | | | | | | | | | | | | | This test was skipped 12 years ago because it was flaky on FreeBSD and OpenBSD. Since then, Ruby's SIGCHLD handling has been substantially re-written (mostly by Eric Wong @normalperson in 44fc3d08). These tests now in fact pass reliably on Ruby master on FreeBSD 13.2 and OpenBSD 7.3. I stress-tested the test_wait_and_sigchild test on my laptop by running four copies of the test in a loop on a 8-core VM; both by itself and also as part of the whole test_process.rb file. I did not see any failures. Let's unskip the test and close [#4173] out. I'll keep an eye out on Ruby CI for any flakes in this file on BSD after this gets merged, but if we don't see any I'm going to assume 44fc3d08 or related changes around that time accidently fixed this bug. It's also probably important to unskip this test so that if another attempt at removing the special SIGCHLD handling is made (like was reverted in https://github.com/ruby/ruby/pull/7517), we get signal if that breaks on FreeBSD/OpenBSD. [Fixes #4173]
* `rb_io_puts` should not write zero length strings. (#7806)Samuel Williams2023-05-151-0/+28
|
* [Bug #19025] Numbered parameter names are always local variablesNobuyoshi Nakada2023-05-141-0/+1
|
* Prevent warning: assigned but unused variableYusuke Endoh2023-05-103-3/+3
| | | | | | | | | http://rubyci.s3.amazonaws.com/debian10/ruby-master/log/20230510T123003Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/objspace/test_objspace.rb:224: warning: assigned but unused variable - c4 /home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_class.rb:362: warning: assigned but unused variable - e /home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_process.rb:2602: warning: assigned but unused variable - parent_pid ```
* [Bug #19597] Freeze script nameNobuyoshi Nakada2023-05-101-0/+5
|
* ext/readline is retiredHiroshi SHIBATA2023-05-101-1/+0
|
* Extract ext/readlineHiroshi SHIBATA2023-05-093-1282/+0
|
* [ruby/reline] Fix dialog corrupts rendering by pushing up input linetomoya ishida2023-05-071-3/+17
| | | | | | | | | | | | | | | | | | | too much (https://github.com/ruby/reline/pull/524) * Do not render dialog where it overflows screen * Dialog rendering should Scroll down only when needed * Refactor screen_y_range calculation Co-authored-by: Stan Lo <stan001212@gmail.com> --------- https://github.com/ruby/reline/commit/bc0e3d1310 Co-authored-by: Stan Lo <stan001212@gmail.com>
* Continue checking all gemspec files after errorsNobuyoshi Nakada2023-05-051-1/+1
|
* [ruby/uri] Define test cases as qualified class namesNobuyoshi Nakada2023-05-056-43/+7
| | | | https://github.com/ruby/uri/commit/aaa22a2443
* [ruby/uri] Increase repeat orders of magnitudeNobuyoshi Nakada2023-05-051-1/+1
| | | | https://github.com/ruby/uri/commit/cfbeade935
* test_default_gems.rb: Stop using `git ls-files`Nobuyoshi Nakada2023-05-041-7/+11
| | | | | | | | Just validate syntax and the result class instead. Not only `git ls-files` doesn't make sence under ruby's repository, some gemspec files hardcode `2>/dev/null`, which doesn't work of course on other than Unix-like platforms.
* Define `RubyVM::Shape` dependent test only if availableNobuyoshi Nakada2023-05-041-2/+2
|
* Make the maximum shapes variation warning non-verboseJean Boussier2023-05-031-1/+1
| | | | | | | | [Feature #19538] Since that category is not enabled by default, making it a verbose warning is redundant. Enabling performance warning should work with the default verbosity level.
* Allow EPIPE when the child process has exited before interruptNobuyoshi Nakada2023-05-021-0/+2
|
* [Bug #19619] Preserve numbered parameters contextNobuyoshi Nakada2023-05-021-0/+2
| | | | Preserve numbered parameters context across method definitions
* [ruby/rdoc] Fix references to nested label in table_of_contentsNobuyoshi Nakada2023-05-021-1/+11
| | | | | | Fixes https://github.com/ruby/rdoc/pull/1000 https://github.com/ruby/rdoc/commit/291e2b7e8b
* [rubygems/rubygems] Bump rb-sysdependabot[bot]2023-05-022-5/+5
| | | | | | | | | | | | | | | Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.74 to 0.9.75. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.74...v0.9.75) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
* [ruby/reline] Rewrite dialog renderingtomoya ishida2023-05-012-3/+33
| | | | | | | | | | | | (https://github.com/ruby/reline/pull/492) * Rewrite dialog rendering * Fix failing test of dialog with small screen * Add multiple-dialog rendering test * Add description comments for each part of render_dialog_changes
* [Bug #19624] Hide internal IO for backquoteNobuyoshi Nakada2023-05-011-0/+13
|
* Handle private AREF call in compile.cNobuyoshi Nakada2023-04-301-0/+8
|
* Relax timeout limit for FreeBSD again [ci skip]Nobuyoshi Nakada2023-04-301-1/+1
|
* [ruby/rdoc] Fix polynominal backtrackingNobuyoshi Nakada2023-04-291-0/+9
| | | | | | Fix https://github.com/ruby/rdoc/pull/995 https://github.com/ruby/rdoc/commit/1311ca8c50
* [ruby/rdoc] Fix polynominal backtrackingNobuyoshi Nakada2023-04-291-0/+7
| | | | | | Fix https://github.com/ruby/rdoc/pull/995 https://github.com/ruby/rdoc/commit/adfa7db5b9
* Revert "[ruby/rdoc] Update test libraries from ruby/ruby 2023-04-29"Hiroshi SHIBATA2023-04-294-1224/+0
| | | | This reverts commit 966f0d91e2a86fa1347cdafbe1af47e7350aa4ca.
* [ruby/rdoc] Update test libraries from ruby/ruby 2023-04-29Nobuyoshi Nakada2023-04-284-0/+1224
| | | | | | From https://github.com/ruby/ruby/commit/74028c210c23a13b3168886efcf837b4bf930468 https://github.com/ruby/rdoc/commit/badc518c57
* [Bug #19611] Remove never-reachable branch in logical expressionNobuyoshi Nakada2023-04-271-0/+10
|
* [ruby/irb] Use a more tolerant way to check Locale#find's returnStan Lo2023-04-261-4/+4
| | | | | | | path (https://github.com/ruby/irb/pull/572) https://github.com/ruby/irb/commit/0b648adf38
* [ruby/irb] Add tests for Locale#find and Locale#loadStan Lo2023-04-261-0/+35
| | | | | | (https://github.com/ruby/irb/pull/570) https://github.com/ruby/irb/commit/710d5b1af5
* Wrap `undef_method :a` with `ensure`Gary Tou2023-04-261-2/+2
|
* Test: `defined?(super)` in `BasicObject` returns `nil`Gary Tou2023-04-261-0/+14
| | | | Ensure it returns `nil` instead of segmentation faulting
* [ruby/irb] Fix Locale's encoding lookup for Japanese encodingsStan Lo2023-04-261-2/+2
| | | | | | | | | | | | | | (https://github.com/ruby/irb/pull/568) In https://github.com/ruby/irb/commit/3ee79e89adb8e21b63d796e53bcc86281685076d, `encoding_aliases.rb` was introduced to return the correct encoding object for `ujis` and `euc` encodings. However, the return value of `@@legacy_encoding_alias_map[@encoding_name]` is always overridden by a second look up with `Encoding.find(@encoding_name)`. So the logic didn't work as expected. This commit fixes the problem.
* Revert "Temporary skipped failing assertions"Hiroshi SHIBATA2023-04-261-2/+2
| | | | This reverts commit e7cdce83e8c8797c481ccb54c260c0db1e1afa7c.
* [ruby/pp] Remove patch added for Ruby 2.6/JRuby 9.3Stan Lo2023-04-251-9/+0
| | | | https://github.com/ruby/pp/commit/09dae96129
* [ruby/pp] Skip certain tests for JRubyStan Lo2023-04-251-1/+3
| | | | https://github.com/ruby/pp/commit/f7bde31ca9
* Speed up calling iseq bmethodsJeremy Evans2023-04-251-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, bmethod arguments are copied from the VM stack to the C stack in vm_call_bmethod, then copied from the C stack to the VM stack later in invoke_iseq_block_from_c. This is inefficient. This adds vm_call_iseq_bmethod and vm_call_noniseq_bmethod. vm_call_iseq_bmethod is an optimized method that skips stack copies (though there is one copy to remove the receiver from the stack), and avoids calling vm_call_bmethod_body, rb_vm_invoke_bmethod, invoke_block_from_c_proc, invoke_iseq_block_from_c, and vm_yield_setup_args. Th vm_call_iseq_bmethod argument handling is similar to the way normal iseq methods are called, and allows for similar performance optimizations when using splats or keywords. However, even in the no argument case it's still significantly faster. A benchmark is added for bmethod calling. In my environment, it improves bmethod calling performance by 38-59% for simple bmethod calls, and up to 180% for bmethod calls passing literal keywords on both sides. ``` ./miniruby-iseq-bmethod: 18159792.6 i/s ./miniruby-m: 13174419.1 i/s - 1.38x slower bmethod_simple_1 ./miniruby-iseq-bmethod: 15890745.4 i/s ./miniruby-m: 10008972.7 i/s - 1.59x slower bmethod_simple_0_splat ./miniruby-iseq-bmethod: 13142804.3 i/s ./miniruby-m: 11168595.2 i/s - 1.18x slower bmethod_simple_1_splat ./miniruby-iseq-bmethod: 12375791.0 i/s ./miniruby-m: 8491140.1 i/s - 1.46x slower bmethod_no_splat ./miniruby-iseq-bmethod: 10151258.8 i/s ./miniruby-m: 8716664.1 i/s - 1.16x slower bmethod_0_splat ./miniruby-iseq-bmethod: 8138802.5 i/s ./miniruby-m: 7515600.2 i/s - 1.08x slower bmethod_1_splat ./miniruby-iseq-bmethod: 8028372.7 i/s ./miniruby-m: 5947658.6 i/s - 1.35x slower bmethod_10_splat ./miniruby-iseq-bmethod: 6953514.1 i/s ./miniruby-m: 4840132.9 i/s - 1.44x slower bmethod_100_splat ./miniruby-iseq-bmethod: 5287288.4 i/s ./miniruby-m: 2243218.4 i/s - 2.36x slower bmethod_kw ./miniruby-iseq-bmethod: 8931358.2 i/s ./miniruby-m: 3185818.6 i/s - 2.80x slower bmethod_no_kw ./miniruby-iseq-bmethod: 12281287.4 i/s ./miniruby-m: 10041727.9 i/s - 1.22x slower bmethod_kw_splat ./miniruby-iseq-bmethod: 5618956.8 i/s ./miniruby-m: 3657549.5 i/s - 1.54x slower ```
* Generalize cfunc large array splat fix to fix many additional cases raising ↵Jeremy Evans2023-04-251-1/+882
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SystemStackError Originally, when 2e7bceb34ea858649e1f975a934ce1894d1f06a6 fixed cfuncs to no longer use the VM stack for large array splats, it was thought to have fully fixed Bug #4040, since the issue was fixed for methods defined in Ruby (iseqs) back in Ruby 2.2. After additional research, I determined that same issue affects almost all types of method calls, not just iseq and cfunc calls. There were two main types of remaining issues, important cases (where large array splat should work) and pedantic cases (where large array splat raised SystemStackError instead of ArgumentError). Important cases: ```ruby define_method(:a){|*a|} a(*1380888.times) def b(*a); end send(:b, *1380888.times) :b.to_proc.call(self, *1380888.times) def d; yield(*1380888.times) end d(&method(:b)) def self.method_missing(*a); end not_a_method(*1380888.times) ``` Pedantic cases: ```ruby def a; end a(*1380888.times) def b(_); end b(*1380888.times) def c(_=nil); end c(*1380888.times) c = Class.new do attr_accessor :a alias b a= end.new c.a(*1380888.times) c.b(*1380888.times) c = Struct.new(:a) do alias b a= end.new c.a(*1380888.times) c.b(*1380888.times) ``` This patch fixes all usage of CALLER_SETUP_ARG with splatting a large number of arguments, and required similar fixes to use a temporary hidden array in three other cases where the VM would use the VM stack for handling a large number of arguments. However, it is possible there may be additional cases where splatting a large number of arguments still causes a SystemStackError. This has a measurable performance impact, as it requires additional checks for a large number of arguments in many additional cases. This change is fairly invasive, as there were many different VM functions that needed to be modified to support this. To avoid too much API change, I modified struct rb_calling_info to add a heap_argv member for storing the array, so I would not have to thread it through many functions. This struct is always stack allocated, which helps ensure sure GC doesn't collect it early. Because of how invasive the changes are, and how rarely large arrays are actually splatted in Ruby code, the existing test/spec suites are not great at testing for correct behavior. To try to find and fix all issues, I tested this in CI with VM_ARGC_STACK_MAX to -1, ensuring that a temporary array is used for all array splat method calls. This was very helpful in finding breaking cases, especially ones involving flagged keyword hashes. Fixes [Bug #4040] Co-authored-by: Jimmy Miller <jimmy.miller@shopify.com>
* Temporary skipped failing assertionsHiroshi SHIBATA2023-04-251-2/+2
|
* [ruby/irb] Add tests for Locale classStan Lo2023-04-251-0/+83
| | | | | | (https://github.com/ruby/irb/pull/566) https://github.com/ruby/irb/commit/df32e024be
* [rubygems/rubygems] Bump rb-sysdependabot[bot]2023-04-242-5/+5
| | | | | | | | | | | | | | | Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.72 to 0.9.74. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.72...v0.9.74) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
* Allow anonymous memberless StructJeremy Evans2023-04-241-1/+0
| | | | | | | Previously, named memberless Structs were allowed, but anonymous memberless Structs were not. Fixes [Bug #19416]
* [ruby/irb] Simplify the help command's implementationStan Lo2023-04-241-3/+5
| | | | | | | | | | | | (https://github.com/ruby/irb/pull/564) The current method-redefining approach brings little benefit, makes it harder to understand the code, and causes warnings like: > warning: method redefined; discarding old execute This patch simplifies it while displaying more helpful message when rdoc couldn't be loaded.
* [ruby/irb] Filter out top-level methods when using `lsStan Lo2023-04-241-1/+4
| | | | | | | | | <Class/Module>` (https://github.com/ruby/irb/pull/562) Instead of always printing methods inherited from Class or Module, IRB by default should filter them out unless `<Class/Module>` is specified to be either of those.
* Use UTF-8 encoding for literal extended regexps with UTF-8 characters in ↵Jeremy Evans2023-04-231-0/+7
| | | | | | comments Fixes [Bug #19455]
* YJIT: invokesuper: Remove cme mid matching checkJohn Hawthorn2023-04-201-0/+19
| | | | | | | | | | This check was introduced to match an assertion in the C YJIT when this was originally introduced. I don't believe it's necessary for correctness of the generated code. Co-authored-by: Adam Hess <HParker@github.com> Co-authored-by: Daniel Colson <danieljamescolson@gmail.com> Co-authored-by: Luan Vieira <luanzeba@github.com>