summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2022-01-14[rubygems/rubygems] Remove redundant conditionBenoit Daloze
See https://github.com/rubygems/rubygems/pull/5210#discussion_r784807168 https://github.com/rubygems/rubygems/commit/cd0e961e81
2022-01-14Add a Module#const_added callbackJean Boussier
[Feature #17881] Works similarly to `method_added` but for constants. ```ruby Foo::BAR = 42 # call Foo.const_added(:FOO) class Foo::Baz; end # call Foo.const_added(:Baz) Foo.autoload(:Something, "path") # call Foo.const_added(:Something) ``` Notes: Merged: https://github.com/ruby/ruby/pull/4521
2022-01-14[ruby/net-http] Fix unescaped `.` in RegexpKazuhiro NISHIYAMA
Use `include?` instead. https://github.com/ruby/net-http/commit/05022744a9
2022-01-13[rubygems/rubygems] Let Version#spaceship accept a StringAkira Matsuda
With this patch, handwriting version comparisons become a little bit easier. before: SomeGem.version <=> Gem::Version.new('1.3') after: SomeGem.version <=> '1.3' https://github.com/rubygems/rubygems/commit/7e0dbb79f2
2022-01-13T#dup (T < Proc) should return T's objectKoichi Sasada
T#dup (T < Proc) returns Proc object (not T) from Ruby 1.9. [Bug #17545] Notes: Merged: https://github.com/ruby/ruby/pull/4197
2022-01-13thread.c: Convert TAG_BREAK to a normal exception at thread top-levelYusuke Endoh
[Bug #18475] Notes: Merged: https://github.com/ruby/ruby/pull/5431
2022-01-12Make embedded string length a long for VWAPeter Zhu
A short (2 bytes) will cause unaligned struct accesses when strings are used as a buffer to directly store binary data. Notes: Merged: https://github.com/ruby/ruby/pull/5432
2022-01-12[ruby/optparse] Fix for ruby 3.0 or earlierNobuyoshi Nakada
https://github.com/ruby/optparse/commit/9e29d86c12
2022-01-12[ruby/optparse] DidYouMean::PlainFormatter is deprecatedNobuyoshi Nakada
https://github.com/ruby/optparse/commit/0ac9957696
2022-01-12[ruby/io-nonblock] Use omit instead of skip for test-unitHiroshi SHIBATA
https://github.com/ruby/io-nonblock/commit/a7bfbfa049
2022-01-12[ruby/rinda] Use omit instead of skip for test-unitHiroshi SHIBATA
https://github.com/ruby/rinda/commit/1d3512aa26
2022-01-12[ruby/io-wait] Use omit instead of skip for test-unitHiroshi SHIBATA
https://github.com/ruby/io-wait/commit/75543ab1bc
2022-01-12[ruby/date] Use omit instead of skip for test-unitHiroshi SHIBATA
https://github.com/ruby/date/commit/537f3f681e
2022-01-12[ruby/open3] Use omit instead of skip for test-unitHiroshi SHIBATA
https://github.com/ruby/open3/commit/f6ca124b56
2022-01-12[ruby/win32ole] Use omit() for skip()Hiroshi SHIBATA
https://github.com/ruby/win32ole/commit/2d5dc47ed4
2022-01-12[ruby/win32ole] Use omit instead of skip for test-unitHiroshi SHIBATA
https://github.com/ruby/win32ole/commit/c0586b2f75
2022-01-12[ruby/resolv] Use omit instead of skip for test-unitHiroshi SHIBATA
https://github.com/ruby/resolv/commit/55e42221d4
2022-01-12[ruby/resolv] Support more characters in link local addressesJeremy Evans
Implements [Feature #17524] https://github.com/ruby/resolv/commit/993a1a374f
2022-01-11[ruby/tmpdir] Use omit instead of skip for test-unitHiroshi SHIBATA
https://github.com/ruby/tmpdir/commit/40107b59b3
2022-01-11[ruby/net-http] Use omit instead of skip for test-unitHiroshi SHIBATA
https://github.com/ruby/net-http/commit/843d4548de
2022-01-11[ruby/find] Use omit instead of skip for test-unitHiroshi SHIBATA
https://github.com/ruby/find/commit/0ebbd5b852
2022-01-11[ruby/zlib] Use omit instead of skip for test-unitHiroshi SHIBATA
https://github.com/ruby/zlib/commit/5f23cd3009
2022-01-11Use omit instead of skip without the default gems testsHiroshi SHIBATA
2022-01-11Reject command line option ending with `-`Nobuyoshi Nakada
2022-01-11[ruby/reline] Clear dialog when just_move_cursor is called with dialog at ↵aycabta
last line https://github.com/ruby/reline/commit/05024b968e
2022-01-10YJIT: Support kwargs for cfuncJohn Hawthorn
This adds support for passing keyword arguments to cfuncs. This is done by calling a helper method to create the hash from the top N values on the stack (determined by the callinfo) and then moving that value onto the stack. Notes: Merged: https://github.com/ruby/ruby/pull/5397
2022-01-08Do not run the same tests twiceNobuyoshi Nakada
2022-01-08Run an old fixed bug in the same processNobuyoshi Nakada
2022-01-08Run the tests on a subclass of StringNobuyoshi Nakada
2022-01-07[ruby/pathname] Make Pathname#each_entry return enumerator if called without ↵Jeremy Evans
block Fixes [Bug #18158] https://github.com/ruby/pathname/commit/914c726aa2
2022-01-06Update test/ruby/test_module.rbJeremy Evans
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/5398
2022-01-06Allow include before calling Module#initializeJeremy Evans
This is to allow Module subclasses that include modules before calling super in the subclass's initialize. Remove rb_module_check_initializable from Module#initialize. Module#initialize only calls module_exec if a block is passed, it doesn't have other issues that would cause problems if called multiple times or with an already initialized module. Move initialization of super to Module#allocate, though I'm not sure it is required there. However, it's needed to be removed from Module#initialize for this to work. Fixes [Bug #18292] Notes: Merged: https://github.com/ruby/ruby/pull/5398
2022-01-06[rubygems/rubygems] Fix suggestions flagximenasandoval
https://github.com/rubygems/rubygems/commit/b55a1393ca
2022-01-06[rubygems/rubygems] Let fetch understand gem:version syntaxximenasandoval
Fix version error message Add tests to fetch error messages Fix default version since is not necessary https://github.com/rubygems/rubygems/commit/070620ebe4
2022-01-06[rubygems/rubygems] Fix `gem install <non-existent-gem> --force` crashDavid Rodríguez
Before: ``` $ gem install sfdsfdsfsdide --force ERROR: While executing gem ... (NoMethodError) undefined method `spec' for nil:NilClass @always_install << newest.spec ^^^^^ ``` After: ``` $ gem install sfdsfdsfsdide --force ERROR: Could not find a valid gem 'sfdsfdsfsdide' (>= 0) in any repository ``` https://github.com/rubygems/rubygems/commit/4e2bfd1101
2022-01-06[ruby/reline] windows: test_yamatanooroti fixYO4
windows can't create too narrow and tall window. https://github.com/ruby/reline/commit/20b5f2f6fc
2022-01-05Remove Refinement#{extend_object,append_features,prepend_features}Jeremy Evans
Also make include, prepend, and extend raise a TypeError if one of the modules is a refinement. Implements [Feature #18270] Notes: Merged: https://github.com/ruby/ruby/pull/5358
2022-01-05test/ruby/test_refinement.rb: Remove "assigned but unused variable"Yusuke Endoh
2022-01-05Add Module#refinements and Refinement#refined_class [Feature #12737]Shugo Maeda
2022-01-05Add Module.used_refinementsShugo Maeda
2022-01-05Fix `Leaked file descriptor: TestIO_Console#test_console_kw`Kazuhiro NISHIYAMA
``` Leaked file descriptor: TestIO_Console#test_console_kw: 10 : #<File:/dev/tty> ```
2022-01-05[rubygems/rubygems] Fix race conditon on JRubyDavid Rodríguez
On JRuby, sometimes we get the following error in CI when running a realworld test that checks that `gem install rails` succeeds: ``` ERROR: While executing gem ... (NoMethodError) undefined method `ignored=' for nil:NilClass /home/runner/.rubies/jruby-9.3.2.0/lib/ruby/stdlib/rubygems/stub_specification.rb:193:in `to_spec' org/jruby/RubyArray.java:2642:in `map' /home/runner/.rubies/jruby-9.3.2.0/lib/ruby/stdlib/rubygems/specification.rb:758:in `_all' /home/runner/.rubies/jruby-9.3.2.0/lib/ruby/stdlib/rubygems/specification.rb:956:in `each' org/jruby/RubyEnumerable.java:1710:in `any?' /home/runner/.rubies/jruby-9.3.2.0/lib/ruby/stdlib/rubygems/resolver/activation_request.rb:111:in `installed?' /home/runner/.rubies/jruby-9.3.2.0/lib/ruby/stdlib/rubygems/request_set.rb:173:in `block in install' ``` I'm not sure how this error is happening, but I think there's no need to copy the `@ignored` instance variable when materializing stub specifications. This instance variable is used to not print a warning about missing extensions more than once for each gem upon gem activation, but as far as I can see, it's only used by methods that work on specification stubs. Once specifications are materialized, I think it can be safely ignored. https://github.com/rubygems/rubygems/commit/301cecd5a7
2022-01-04Don't segfault if Warning.warn is undefinedJeremy Evans
Check that there is a method entry for the method before passing it to rb_method_entry_arity. Fixes [Bug #18458] Notes: Merged: https://github.com/ruby/ruby/pull/5391
2022-01-04[Feature #18364] Add GC.stat_heap to get stats for memory heapsPeter Zhu
GC.stat_heap will return stats for memory heaps. This is used for the Variable Width Allocation feature. Notes: Merged: https://github.com/ruby/ruby/pull/5177
2022-01-04[ruby/error_highlight] Add a test to check if it is robust against a spoofed ↵Yusuke Endoh
filename Previously, RubyVM::AST.of opened a wrong file if the iseq's file path is spoofed. ``` module Dummy binding.irb end ``` ``` $ ruby test.rb From: test.rb @ line 2 : 1: module Dummy => 2: binding.irb 3: end irb(Dummy):001:0> foo /home/mame/work/ruby/local/lib/ruby/3.1.0/error_highlight/base.rb:412:in `spot_colon2': undefined method `last_lineno' for nil:NilClass (NoMethodError) if nd_parent.last_lineno == @node.last_lineno ^^^^^^^^^^^^ ``` Found by @kateinoigakukun This issue is already fixed in the interpreter side. This change just adds a test for the case. https://github.com/ruby/error_highlight/commit/f3626b9032
2022-01-04[ruby/error_highlight] Fix the spurious TypeError.Christian Boos
When we have no backtrace locations, we can't have the highlight, so just return the message. https://github.com/ruby/error_highlight/commit/9f5c639494
2022-01-04[ruby/error_highlight] Reproduce the error seen when calling .to_s in ↵Christian Boos
embedded Ruby The test fails with the following error: Error: test_simulate_funcallv_from_embedded_ruby(ErrorHighlightTest): TypeError: wrong argument type nil (expected method) https://github.com/ruby/error_highlight/commit/52943c9cd2
2022-01-04Fix the previous commitYusuke Endoh
2022-01-04test/ruby/test_method.rb: Fix a random failure during `make COVERAGE=1`Yusuke Endoh
This fixes the following failure. ``` 1) Error: TestMethod#test_method_list: NoMethodError: undefined method `<=>' for #<BasicObject:0x00007f7757e7eb60> mods = mods.sort_by {|m| m.name } ^^^^^^^^ ``` https://github.com/ruby/actions/runs/4699487470?check_suite_focus=true TestNoMethodError#test_to_s creates an anonymous module whose `#name` method returns a BasicObject. https://github.com/ruby/ruby/blob/f0669fb6cbdbad499974252ef2d955a608d0adc1/test/ruby/test_nomethod_error.rb#L95-L99 TestMethod#test_method_list uses `ObjectSpace.each_object(Module)` to gather all Modules and attempts to sort them by `#name`. But the anonymous module returns a BasicObject, which leads to the test failure above.
2022-01-04Use omit instead of skip: test/ruby/**/*.rbHiroshi SHIBATA