summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2022-11-25Fix autoload status of statically linked extensionsAlan Wu
Previously, for statically-linked extensions, we used `vm->loading_table` to delay calling the init function until the extensions are required. This caused the extensions to look like they are in the middle of being loaded even before they're required. (`rb_feature_p()` returned true with a loading path output.) Combined with autoload, queries like `defined?(CONST)` and `Module#autoload?` were confused by this and returned nil incorrectly. RubyGems uses `defined?` to detect if OpenSSL is available and failed when OpenSSL was available in builds using `--with-static-linked-ext`. Use a dedicated table for the init functions instead of adding them to the loading table. This lets us remove some logic from non-EXTSTATIC builds. [Bug #19115] Notes: Merged: https://github.com/ruby/ruby/pull/6756
2022-11-25[rubygems/rubygems] Stop installing everything under "lib" at the top in all ↵Nobuyoshi Nakada
tests https://github.com/rubygems/rubygems/commit/f9772d62e1
2022-11-25[Bug #18971] Add precheck to enumeratorNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6809
2022-11-24Make String#rstrip{,!} raise Encoding::CompatibilityError for broken coderangeJeremy Evans
It's questionable whether we want to allow rstrip to work for strings where the broken coderange occurs before the trailing whitespace and not after, but this approach is probably simpler, and I don't think users should expect string operations like rstrip to work on broken strings. In some cases, this changes rstrip to raise Encoding::CompatibilityError instead of ArgumentError. However, as the problem is related to an encoding issue in the receiver, and due not due to an issue with an argument, I think Encoding::CompatibilityError is the more appropriate error. Fixes [Bug #18931] Notes: Merged: https://github.com/ruby/ruby/pull/6282
2022-11-25[ruby/fileutils] [Feature #18925] Add `ln_sr` method and `relative:` option ↵Nobuyoshi Nakada
to `ln_s` https://github.com/ruby/fileutils/commit/5116088d5c
2022-11-24Raise TypeError for endless non-numeric range include?Jeremy Evans
Beginless ranges previously raised TypeError for this case, except for string ranges, which had unexpected behavior: ('a'..'z').include?('ww') # false (..'z').include?('ww') # previously true, now TypeError Use of include? with endless ranges could previously result in an infinite loop. This splits off a range_string_cover_internal function from range_include_internal. Fixes [Bug #18580] Notes: Merged: https://github.com/ruby/ruby/pull/6261
2022-11-24[ruby/erb] Drop deprecated -S option from erb commandTakashi Kokubun
We attempted to remove things like this and reverted all of them, but I think nobody relies on this unlike the positional arguments of `ERB#initialize`. https://github.com/ruby/erb/commit/92fde7e403
2022-11-24[ruby/erb] Suppress warnings to fix ruby-head CITakashi Kokubun
(https://github.com/ruby/erb/pull/34) There seems to be no way to fix this. It doesn't happen in an installed directory, so it's likely a false positive and/or a bug in rubygems. | <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85: warning: <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85: warning: loading in progress, circular require considered harmful - /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/setup.rb | from /home/runner/work/erb/erb/libexec/erb:0:in `require' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/setup.rb:3:in `<top (required)>' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/setup.rb:3:in `require_relative' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/shared_helpers.rb:8:in `<top (required)>' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/shared_helpers.rb:8:in `require_relative' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/rubygems_integration.rb:3:in `<top (required)>' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/rubygems_integration.rb:3:in `require' | from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems.rb:1352:in `<top (required)>' | from <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85:in `require' | from <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85:in `require'
2022-11-24[ruby/cgi] Fix test_cgi_cookie_new_with_domain to pass on older rubiesJean Boussier
https://github.com/ruby/cgi/commit/05f0c58048
2022-11-24Relax the timeout of TestRegexp#test_cache_optimization_squareYusuke Endoh
It fails on riscv (QEmu) http://rubyci.s3.amazonaws.com/debian-riscv64/ruby-master/log/20221124T000021Z.fail.html.gz ``` 1) Error: TestRegexp#test_cache_optimization_square: Regexp::TimeoutError: regexp match timeout /home/rubyci/chkbuild/tmp/build/20221124T000021Z/ruby/test/ruby/test_regexp.rb:1693:in `<main>' /home/rubyci/chkbuild/tmp/build/20221124T000021Z/ruby/test/ruby/test_regexp.rb:1688:in `test_cache_optimization_square' ```
2022-11-22Add Time#deconstruct_keyszverok
Notes: Merged: https://github.com/ruby/ruby/pull/6594
2022-11-22Use dedicated assertions for warningsNobuyoshi Nakada
2022-11-22Avoid unnecessary use of global variablesNobuyoshi Nakada
2022-11-22[ruby/cgi] Relax domain label restrictionsNobuyoshi Nakada
https://github.com/ruby/cgi/commit/b46d41c363
2022-11-22[ruby/cgi] Prevent CRLF injectionYusuke Endoh
Throw a RuntimeError if the HTTP response header contains CR or LF to prevent HTTP response splitting. https://hackerone.com/reports/1204695 https://github.com/ruby/cgi/commit/64c5045c0a
2022-11-22[ruby/cgi] Check cookie name/path/domain charactersNobuyoshi Nakada
https://hackerone.com/reports/1204977 https://github.com/ruby/cgi/commit/30107a4797
2022-11-21Add RVALUE_OVERHEAD and move ractor_belonging_idPeter Zhu
This commit adds RVALUE_OVERHEAD for storing metadata at the end of the slot. This commit moves the ractor_belonging_id in debug builds from the flags to RVALUE_OVERHEAD which frees the 16 bits in the headers for object shapes. Notes: Merged: https://github.com/ruby/ruby/pull/6763
2022-11-22[Bug #19016] `SyntaxError` with parser error messagesNobuyoshi Nakada
Raise a `SyntaxError` with the parser error message, in the case reading from a file instead of the `-e` option or standard input. So syntax_suggest can get the message from the caught error. Notes: Merged: https://github.com/ruby/ruby/pull/6778
2022-11-22[Bug #19016] re-order error handling at cleanupNobuyoshi Nakada
Build and store the error message with `#detailed_message` before terminating all Ractors, then show the message later. Notes: Merged: https://github.com/ruby/ruby/pull/6778
2022-11-21[ruby/irb] Add commands to start and use the debuggerTakashi Kokubun
(https://github.com/ruby/irb/pull/449) * Seamlessly integrate a few debug commands * Improve the break command support * Utilize skip_src option if available * Add step and delete commands * Write end-to-end tests for each debugger command * Add documentation * Add backtrace, info, catch commands https://github.com/ruby/irb/commit/976100c1c2
2022-11-21Prevent a "warning: ambiguity between regexp and two divisions"Yusuke Endoh
2022-11-21Enhance keep_tokens option for RubyVM::AbstractSyntaxTree parsing methodsyui-knk
Implementation for Language Server Protocol (LSP) sometimes needs token information. For example both `m(1)` and `m(1, )` has same AST structure other than node locations then it's impossible to check the existence of `,` from AST. However in later case, it might be better to suggest variables list for the second argument. Token information is important for such case. This commit adds these methods. * Add `keep_tokens` option for `RubyVM::AbstractSyntaxTree.parse`, `.parse_file` and `.of` * Add `RubyVM::AbstractSyntaxTree::Node#tokens` which returns tokens for the node including tokens for descendants nodes. * Add `RubyVM::AbstractSyntaxTree::Node#all_tokens` which returns all tokens for the input script regardless the receiver node. [Feature #19070] Impacts on memory usage and performance are below: Memory usage: ``` $ cat test.rb root = RubyVM::AbstractSyntaxTree.parse_file(File.expand_path('../test/ruby/test_keyword.rb', __FILE__), keep_tokens: true) $ /usr/bin/time -f %Mkb /usr/local/bin/ruby -v ruby 3.2.0dev (2022-11-19T09:41:54Z 19070-keep_tokens d3af1b8057) [x86_64-linux] 11408kb # keep_tokens :false $ /usr/bin/time -f %Mkb /usr/local/bin/ruby test.rb 17508kb # keep_tokens :true $ /usr/bin/time -f %Mkb /usr/local/bin/ruby test.rb 30960kb ``` Performance: ``` $ cat ../ast_keep_tokens.yml prelude: | src = <<~SRC module M class C def m1(a, b) 1 + a + b end end end SRC benchmark: without_keep_tokens: | RubyVM::AbstractSyntaxTree.parse(src, keep_tokens: false) with_keep_tokens: | RubyVM::AbstractSyntaxTree.parse(src, keep_tokens: true) $ make benchmark COMPARE_RUBY="./ruby" ARGS=../ast_keep_tokens.yml /home/kaneko.y/.rbenv/shims/ruby --disable=gems -rrubygems -I../benchmark/lib ../benchmark/benchmark-driver/exe/benchmark-driver \ --executables="compare-ruby::./ruby -I.ext/common --disable-gem" \ --executables="built-ruby::./miniruby -I../lib -I. -I.ext/common ../tool/runruby.rb --extout=.ext -- --disable-gems --disable-gem" \ --output=markdown --output-compare -v ../ast_keep_tokens.yml compare-ruby: ruby 3.2.0dev (2022-11-19T09:41:54Z 19070-keep_tokens d3af1b8057) [x86_64-linux] built-ruby: ruby 3.2.0dev (2022-11-19T09:41:54Z 19070-keep_tokens d3af1b8057) [x86_64-linux] warming up.. | |compare-ruby|built-ruby| |:--------------------|-----------:|---------:| |without_keep_tokens | 21.659k| 21.303k| | | 1.02x| -| |with_keep_tokens | 6.220k| 5.691k| | | 1.09x| -| ``` Notes: Merged: https://github.com/ruby/ruby/pull/6770
2022-11-20[Bug #19016] Handle syntax error in main script like other errorsNobuyoshi Nakada
So that `SyntaxError#detailed_message` will be used also in the case exiting by such syntax error. Notes: Merged: https://github.com/ruby/ruby/pull/6771
2022-11-19Avoid a timeout on test_cache_optimization_exponentialTakashi Kokubun
The timeout seems too short for some CIs. http://rubyci.s3.amazonaws.com/debian11-aarch64/ruby-master/log/20221120T012840Z.fail.html.gz
2022-11-20[ruby/irb] Push an accidentally uncommitted diffTakashi Kokubun
https://github.com/ruby/irb/commit/7e9f27afd7
2022-11-20[ruby/irb] Deal with inconsistency with ruby/rubyTakashi Kokubun
https://github.com/ruby/irb/commit/41d5012849
2022-11-20[ruby/irb] Require missing EnvUtilTakashi Kokubun
https://github.com/ruby/irb/commit/9bb1757b02
2022-11-20[ruby/irb] Try using a different file nameTakashi Kokubun
hoping to address: https://github.com/ruby/ruby/actions/runs/3506561941/jobs/5873689640 https://github.com/ruby/irb/commit/de9a6b9d00
2022-11-20[ruby/irb] Require rubygems for ruby/rubyTakashi Kokubun
You can't take rubygems for granted in a default gem. https://github.com/ruby/ruby/actions/runs/3506561943/jobs/5873689466 https://github.com/ruby/irb/commit/58bb3954d0
2022-11-19Skip TestDRbSSLAry on mswinTakashi Kokubun
This doesn't seem to stably work on mswin: https://github.com/ruby/ruby/actions/runs/3505363753/jobs/5871633211 For CI stability, it generally seems like a bad idea to run druby tests on Windows, given that it's pretty much unstable on MinGW as well.
2022-11-20[ruby/irb] Fix CI failure on ruby/rubyTakashi Kokubun
https://github.com/ruby/irb/commit/ea8c716922
2022-11-20[ruby/irb] Add edit command (https://github.com/ruby/irb/pull/453)Stan Lo
* Add edit command * Make find_source a public singleton method * Add document for the edit command * Make find_end private * Remove duplicated private https://github.com/ruby/irb/commit/4321674aa7 Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2022-11-19Add test cases for args forwarding after rest argumentyui-knk
Notes: Merged: https://github.com/ruby/ruby/pull/6761
2022-11-18Fix io/console test for --with-static-linked-extAlan Wu
The tests looks for the .so file, which doesn't exist when the extension is statically linked. In that situation it passes -I to ruby with nothing after it which ate the -rio/console argument. Notes: Merged: https://github.com/ruby/ruby/pull/6765
2022-11-18Differentiate T_OBJECT shapes from other objectsAaron Patterson
We would like to differentiate types of objects via their shape. This commit adds a special T_OBJECT shape when we allocate an instance of T_OBJECT. This allows us to avoid testing whether an object is an instance of a T_OBJECT or not, we can just check the shape. Notes: Merged: https://github.com/ruby/ruby/pull/6758
2022-11-18Make anonymous rest arg (*) and block arg (&) accessible from ARGS nodeyui-knk
Notes: Merged: https://github.com/ruby/ruby/pull/6760
2022-11-18Allow anonymous keyword rest parameter with other keyword parametersShugo Maeda
Fixes [Bug #19132] Notes: Merged: https://github.com/ruby/ruby/pull/6743
2022-11-18Prevent a "method redefined" warningYusuke Endoh
http://rubyci.s3.amazonaws.com/ubuntu2004-arm/ruby-master/log/20221118T033003Z.log.html.gz ``` [21350/22024] TestIRB::ExtendCommandTest#test_show_source_end_finder/home/chkbuild/chkbuild/tmp/build/20221118T033003Z/ruby/test/irb/test_cmd.rb:523: warning: method redefined; discarding old show_source_test_method /home/chkbuild/chkbuild/tmp/build/20221118T033003Z/ruby/test/irb/test_cmd.rb:523: warning: previous definition of show_source_test_method was here ```
2022-11-18Prevent a "warning: assigned but unused variable - s2"Yusuke Endoh
2022-11-17Add support for `sockaddr_un` on Windows. (#6513)Samuel Williams
* Windows: Fix warning about undefined if_indextoname() * Windows: Fix UNIXSocket on MINGW and make .pair more reliable * Windows: Use nonblock=true for read tests with scheduler * Windows: Move socket detection from File.socket? to File.stat Add S_IFSOCK to Windows and interpret reparse points accordingly. Enable tests that work now. * Windows: Use wide-char functions to UNIXSocket This fixes behaviour with non-ASCII characters. It also fixes deletion of temporary UNIXSocket.pair files. * Windows: Add UNIXSocket tests for specifics of Windows impl. * Windows: fix VC build due to missing _snwprintf Avoid usage of _snwprintf, since it fails linking ruby.dll like so: linking shared-library x64-vcruntime140-ruby320.dll x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol snwprintf x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol vsnwprintf_l whereas linking miniruby.exe succeeds. This patch uses snprintf on the UTF-8 string instead. Also remove branch GetWindowsDirectoryW, since it doesn't work. * Windows: Fix dangling symlink test failures Co-authored-by: Lars Kanis <kanis@comcard.de> Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-11-17YJIT: Make the code GC test stablerTakashi Kokubun
The first `add_pages` call shouldn't hit Code GC yet; otherwise `compiles` returns false. With the increased code size in runtime_stats itself, it sometimes hits Code GC too early, at least in arm64 that has a large code size.
2022-11-17Drop Ruby 2.5 supportst0012
Because it has reached EOL for more than 1.5 years and it won't be supported by the next reline version either.
2022-11-16YJIT: Show YJIT build option in RUBY_DESCRIPTION (#6738)Takashi Kokubun
YJIT: Show YJIT profile in RUBY_DESCRIPTION Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-11-15[ruby/irb] Improve testing infraStan Lo
(https://github.com/ruby/irb/pull/442) * Add test_in_isolation task to run tests in isolation This simulates how tests are run in Ruby CI and can detect some issues before they're merged and break Ruby CI later. * Run test_in_isolation task on CI * Fix TestRaiseNoBacktraceException's setup https://github.com/ruby/irb/commit/51f23c58b0
2022-11-15Added empty class for test methods in TestIRB casesHiroshi SHIBATA
2022-11-15[ruby/irb] Remove duplicated TestInputMethod definitionsst0012
https://github.com/ruby/irb/commit/4b831d02e1
2022-11-14Rename --mjit-min-calls to --mjit-call-threshold (#6731)Takashi Kokubun
for consistency with YJIT Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-11-14[ruby/error_highlight] Enable tests for TypeError and ArgumentErrorYusuke Endoh
These tests were unintentionally disabled by `if false` https://github.com/ruby/error_highlight/commit/fa6d00d80d
2022-11-13Fix invokebuiltin in Ruby MJITTakashi Kokubun
https://github.com/ruby/ruby/blob/45fe7f757522ed7d1d3ec754da59d41d45dd6bab/tool/ruby_vm/views/_mjit_compile_invokebuiltin.erb#L21 has not been ported correctly.
2022-11-13[ruby/bigdecimal] Tweak check_rounding_mode_optionKenta Murata
https://github.com/ruby/bigdecimal/commit/e1c6c9be25