summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-05-25Disable compaction on platforms that can't support itAaron Patterson
Manual compaction also requires a read barrier, so we need to disable even manual compaction on platforms that don't support mprotect. [Bug #17871] Notes: Merged: https://github.com/ruby/ruby/pull/4528
2021-05-25Removed gdbm from ruby repoHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4526
2021-05-25Removed dbm from ruby repoHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4525
2021-05-25Removed tracer from ruby repoHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4523
2021-05-24Set USE_COLORIZE to the default value in a testaycabta
2021-05-24[ruby/irb] update test/irb/test_init.rb to avoid useless evaljethrodaniel
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> https://github.com/ruby/irb/commit/2dfdc031ec
2021-05-24[ruby/irb] respect NO_COLOR environment variableMark Delk
When `NO_COLOR` is set to any non-nil value, output is not colorized. See https://no-color.org/ https://github.com/ruby/irb/commit/401d0916fe
2021-05-21Use YAML.safe_load to use the permitted_classes optionaycabta
2021-05-22Refined portability of test for [Bug #17739]Nobuyoshi Nakada
The order of arguments to callback of qsort is not defined. That means `a` may not be 3 at all.
2021-05-21Do not allow array modifications after freeze inside sort!Jeremy Evans
If freezing an array inside sort!, previously the array could be modified after the freeze. This checks whether the receiver is frozen after every yield and potential call to #> or #<, preventing modifications if the receiver is frozen inside the block or by the #> or #< call. Fixes [Bug #17739] Notes: Merged: https://github.com/ruby/ruby/pull/4335 Merged-By: jeremyevans <code@jeremyevans.net>
2021-05-21Build CDHASH properly when loading iseq from binaryAlan Wu
Before this change, CDHASH operands were built as plain hashes when loaded from binary. Without setting up the hash with the correct st_table type, the hash can sometimes be an ar_table. When the hash is an ar_table, lookups can call the `eql?` method on keys of the hash, which makes the `opt_case_dispatch` instruction not "leaf" as it implicitly declares. The following script trips the stack canary for checking the leaf attribute for `opt_case_dispatch` on VM_CHECK_MODE > 0 (enabled by default with RUBY_DEBUG). rb_vm_iseq = RubyVM::InstructionSequence iseq = rb_vm_iseq.compile(<<-EOF) case Class.new(String).new("foo") when "foo" 42 end EOF puts rb_vm_iseq.load_from_binary(iseq.to_binary).eval This commit changes the binary loading logic to build CDHASH with the right st_table type. The dumping logic and the dump format stays the same Notes: Merged: https://github.com/ruby/ruby/pull/4511 Merged-By: XrXr
2021-05-21Avoid setting the visibility of refinement method entriesAlan Wu
Since refinement search is always performed, these entries should always be public. The method entry that the refinement search returns decides the visibility. Fixes [Bug #17822] Notes: Merged: https://github.com/ruby/ruby/pull/4515
2021-05-21ripper: wrap endless method in bodystmt [Bug #17869]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4516
2021-05-21ripper: assertions for rescue/ensure in method bodyNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4516
2021-05-21Get rid of sporadic WSAEACCES on Windows [ruby-dev:42661]Nobuyoshi Nakada
2021-05-21simple rescue+while+break should not use `throw`Koichi Sasada
609de71f043e8ba34f22b9993e444e2e5bb05709 fixes the issue by using `throw` insn if `ensure` is used. However, that patch introduce additional `throw` even if it is not needed. This patch solves the issue. This issue is pointed by @mame. Notes: Merged: https://github.com/ruby/ruby/pull/4507
2021-05-21[ruby/rdoc] Drop support for Ruby 2.4Nobuyoshi Nakada
https://github.com/ruby/rdoc/commit/f480b970cc
2021-05-21[ruby/rdoc] Follow-up rubygemsNobuyoshi Nakada
Use test-unit assertions instead of minitest. https://github.com/ruby/rdoc/commit/d6a6209d7f
2021-05-21[ruby/rdoc] Vertical-bar is disallowed in path names on WindowsNobuyoshi Nakada
No risk of remote code execution, when the file cannot be created. https://github.com/ruby/rdoc/runs/2565343916?check_suite_focus=true#step:5:58 ``` Error: test_remove_unparseable_CVE_2021_31799(TestRDocRDoc): Errno::EINVAL: Invalid argument @ utime_failed - | touch evil.txt && echo tags D:/rubyinstaller-head-x64/lib/ruby/3.1.0/fileutils.rb:1142:in `utime' D:/rubyinstaller-head-x64/lib/ruby/3.1.0/fileutils.rb:1142:in `block in touch' D:/rubyinstaller-head-x64/lib/ruby/3.1.0/fileutils.rb:1139:in `each' D:/rubyinstaller-head-x64/lib/ruby/3.1.0/fileutils.rb:1139:in `touch' D:/a/rdoc/rdoc/test/rdoc/test_rdoc_rdoc.rb:463:in `block (2 levels) in test_remove_unparseable_CVE_2021_31799' 460: temp_dir do 461: file_list = ['| touch evil.txt && echo tags'] 462: file_list.each do |f| => 463: FileUtils.touch f 464: end 465: 466: assert_equal file_list, @rdoc.remove_unparseable(file_list) ``` https://github.com/ruby/rdoc/commit/a7df7dc8fa
2021-05-21[ruby/rdoc] Dir.children is 2.5+Nobuyoshi Nakada
RDoc seems still supporting outdated 2.4. https://github.com/ruby/rdoc/runs/2565344070?check_suite_focus=true#step:5:64 ``` Error: test_remove_unparseable_CVE_2021_31799(TestRDocRDoc): NoMethodError: undefined method `children' for Dir:Class /home/runner/work/rdoc/rdoc/test/rdoc/test_rdoc_rdoc.rb:467:in `block in test_remove_unparseable_CVE_2021_31799' 464: end 465: 466: assert_equal file_list, @rdoc.remove_unparseable(file_list) => 467: assert_equal file_list, Dir.children('.') 468: end 469: end 470: ``` https://github.com/ruby/rdoc/commit/5a4a64dc0f
2021-05-21[ruby/rdoc] Use File.open to fix the OS Command Injection vulnerability in ↵aycabta
CVE-2021-31799 https://github.com/ruby/rdoc/commit/a7f5d6ab88
2021-05-20Get rid of sporadic WSAEACCES on Windows [ruby-dev:42661]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4513
2021-05-20compile.c: stop the jump-jump optimization if the second has any eventYusuke Endoh
Fixes [Bug #17868]
2021-05-19Removed minitest/mockHiroshi SHIBATA
2021-05-18test/rubygems/test_gem_commands_open_command.rb: prevent a warningYusuke Endoh
http://rubyci.s3.amazonaws.com/debian9/ruby-master/log/20210518T093002Z.log.html.gz ``` [ 9396/21186] TestGemCommandsOpenCommand#test_execute-e:1: warning: possibly useless use of a literal in void context = 0.06 s ```
2021-05-18test/psych/test_coder.rb: Suppress non-parenthesis warningsYusuke Endoh
http://rubyci.s3.amazonaws.com/debian9/ruby-master/log/20210518T093002Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20210518T093002Z/ruby/test/psych/test_coder.rb:277: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator ```
2021-05-18test/irb/test_raise_no_backtrace_exception.rb: fix test file pathNobuyoshi Nakada
Create a file for test under the temporary directory.
2021-05-18[ruby/fiddle] Do not use a libdir for glibc, it breaks Linux PPC64 (#70)Jeremy Evans
Fixes [Bug #12666] https://github.com/ruby/fiddle/commit/a267a40be7 Notes: Merged: https://github.com/ruby/ruby/pull/4506
2021-05-18[ruby/fiddle] Add support for "const" in typeSutou Kouhei
GitHub: fix #68 Reported by kojix2. Thanks!!! https://github.com/ruby/fiddle/commit/d7322c234a Notes: Merged: https://github.com/ruby/ruby/pull/4506
2021-05-18[ruby/fiddle] closure: add support for const char *Sutou Kouhei
GitHub: fix GH-62 Reported by Cody Krieger. Thanks!!! https://github.com/ruby/fiddle/commit/284b820f2d Notes: Merged: https://github.com/ruby/ruby/pull/4506
2021-05-18[ruby/fiddle] closure: accept symbol as typeSutou Kouhei
https://github.com/ruby/fiddle/commit/dc2da6633e Notes: Merged: https://github.com/ruby/ruby/pull/4506
2021-05-17Revert an accidentally commits at df86a13cc150f573b1078779667a1573747d3dbdHiroshi SHIBATA
2021-05-17Make the test pass with the old libyamlYusuke Endoh
I have no idea what result is right, but it fails with libyaml 0.1.7 (bundled with Ubuntu 18.04) anyway.
2021-05-17assert_equal accepts an expected value as the first argumentYusuke Endoh
2021-05-17lib/rdoc/rdoc.rb: Allow only RDoc::Options in .rdoc_optionsYusuke Endoh
Follow-up of d8fd92f62024d85271a3f1125bc6928409f912e1. Instead of using unsafe_load blindly, RDoc::Options is only supposed to be allowed.
2021-05-17Workaround with fbb4e3f96c10de2240f2d87eac19cf6f62f65fea in rdocHiroshi SHIBATA
2021-05-17Workaround with fbb4e3f96c10de2240f2d87eac19cf6f62f65feaHiroshi SHIBATA
2021-05-17test/ostruct/test_ostruct.rb: Use YAML.unsafe_load instead of YAML.loadYusuke Endoh
Follow-up of fbb4e3f96c10de2240f2d87eac19cf6f62f65fea
2021-05-17[ruby/psych] remove deprecated interfaceAaron Patterson
https://github.com/ruby/psych/commit/0767227051
2021-05-17[ruby/psych] Introduce `Psych.unsafe_load`Aaron Patterson
In future versions of Psych, the `load` method will be mostly the same as the `safe_load` method. In other words, the `load` method won't allow arbitrary object deserialization (which can be used to escalate to an RCE). People that need to load *trusted* documents can use the `unsafe_load` method. This commit introduces the `unsafe_load` method so that people can incrementally upgrade. For example, if they try to upgrade to 4.0.0 and something breaks, they can downgrade, audit callsites, change to `safe_load` or `unsafe_load` as required, and then upgrade to 4.0.0 smoothly. https://github.com/ruby/psych/commit/cb50aa8d3f
2021-05-17[ruby/psych] Removed needless platform detectionHiroshi SHIBATA
https://github.com/ruby/psych/commit/57d704fd63
2021-05-17[ruby/psych] Import test assertions from ruby/rubyHiroshi SHIBATA
https://github.com/ruby/psych/commit/01dda86681
2021-05-17[ruby/psych] Fix symabolize_name with non-string keysJean Boussier
https://github.com/ruby/psych/commit/1c5c29e81f
2021-05-17[ruby/psych] feat: allow scalars and sequences to be styled when dumpedJeremy Ebler
https://github.com/ruby/psych/commit/546154ddb7
2021-05-17[Win32] long path name support [Bug #12551]Gabriel Nagy
Implement long path support on Windows by applying Microsoft's recommended application manifest. To make this work on both Visual C++ and MinGW, include the manifest as a resource when generating the resource files. This way it will be embedded into the executables generated by both compilers. It's important for the manifest resource to have ID 1, otherwise GCC will embed a default manifest. Note that in addition to this, the user needs to have [long paths enabled] either by modifying the registry or by enabling a group policy. [long paths enabled]: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/4505 Merged-By: nobu <nobu@ruby-lang.org>
2021-05-14test/objspace/test_objspace.rb: check stderr before stdoutYusuke Endoh
When `require "objspace/trace"` fails, previously the failure says: ``` 1) Failure: TestObjSpace#test_objspace_trace [/tmp/ruby/v3/src/trunk-mjit/test/objspace/test_objspace.rb:621]: <3> expected but was <0>. ``` but this is hard to debug.
2021-05-14test/ruby/test_refinement.rb: prevent "assigned but unused variable"Yusuke Endoh
2021-05-14ext/objspace/lib/objspace/trace.rb: AddedYusuke Endoh
This file, when require'ed, starts tracing the object allocations, and redefines `Kernel#p` to show the allocation site. This commit is experimental; the library name and APIs may change. [Feature #17762]
2021-05-13Also `\U` after control/meta is invalid [Bug #17861]Nobuyoshi Nakada
As well as `\u`, `\U` should be invalid there too. And highlight including `u`/`U` not only the backslash before it.
2021-05-12Avoid improper optimization of case statements mixed integer/rational/complexJeremy Evans
Fixes [Bug #17857] Notes: Merged: https://github.com/ruby/ruby/pull/4496