summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-02-27YJIT: Detect and reject `send(:alias_for_send, :foo)`Alan Wu
Previously, YJIT failed to put the stack into the correct shape when `BasicObject#send` calls an alias method for the send method itself. This can manifest as strange `NoMethodError`s in the final non-send receiver, as [seen][1] with the kt-paperclip gem. I also found a case where it makes YJIT fail the stack size assertion while compiling `leave`. YJIT's `BasicObject#__send__` implementation already rejects sends to `send`, but didn't detect sends to aliases of `send`. Adjust the detection and reject these cases. Fixes [Bug #19464] [1]: https://github.com/Shopify/yjit/issues/306 Notes: Merged: https://github.com/ruby/ruby/pull/7377
2023-02-27[ruby/irb] Provide more useful message whenStan Lo
`IRB::Inspector#inspect_value` errors (https://github.com/ruby/irb/pull/511) **Before** ``` irb(main):001:0> c = Cat.new "foo" (Object doesn't support #inspect) => ``` **After** ``` irb(main):001:0> c = Cat.new "foo" An error occurred when inspecting the object: #<NoMethodError: undefined method `is_a?' for foo:Cat if obj.is_a?(String) ^^^^^^> Result of Kernel#inspect: #<Cat:0x0000000109090d80 @name="foo"> => ```
2023-02-27[ruby/reline] Fix wrong indent number in prompt. whole_lines hastomoya ishida
duplicated line. (https://github.com/ruby/reline/pull/460) * whole_lines should consider prev_line_index, and must not duplicate last_line * Add test for lines passed to dynamic prompt proc * Refactor whole_lines parameters used in test helper * Remove whole_line's arguments
2023-02-27Prefer to use File.foreach instead of IO.foreachHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7387
2023-02-27Prefer to use File.readlines instead of IO.readlinesHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7387
2023-02-27[ruby/reline] Fix the cause of test_yamatanooroti randomly failingtomoya ishida
(https://github.com/ruby/reline/pull/474) * Add repeated input-delete test that fails on HEAD * Use raw mode while readmultiline
2023-02-27Add all-ruby-quine as a sample codeYusuke Endoh
This sample code works on all release versions of Ruby, from Ruby 0.49. Notes: Merged: https://github.com/ruby/ruby/pull/7380
2023-02-25Add `IO::Buffer.string` for efficient string creation. (#7364)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-02-24YJIT: Generate Block::entry_exit with block entry PCAlan Wu
Previously, when Block::entry_exit is requested from any instruction that is not the first one in the block, we generated the exit with an incorrect PC. We should always be using the PC for the entry of the block for Block::entry_exit. It was a simple typo. The bug was [introduced][1] while we were refactoring to use the current backend. Later, we had a chance to spot this issue while [preparing][2] to enable unused variable warnings, but didn't spot the issue. Fixes [Bug #19463] [1]: 27fcab995e6dde19deb91dc6e291bdb72100af68 [2]: 31461c7e0eab4963ccc8649ea8ebf27979132c0c Notes: Merged: https://github.com/ruby/ruby/pull/7374 Merged-By: XrXr
2023-02-24Fix incorrect line numbers in GC hookPeter Zhu
If the previous instruction is not a leaf instruction, then the PC was incremented before the instruction was ran (meaning the currently executing instruction is actually the previous instruction), so we should not increment the PC otherwise we will calculate the source line for the next instruction. This bug can be reproduced in the following script: ``` require "objspace" ObjectSpace.trace_object_allocations_start a = 1.0 / 0.0 p [ObjectSpace.allocation_sourceline(a), ObjectSpace.allocation_sourcefile(a)] ``` Which outputs: [4, "test.rb"] This is incorrect because the object was allocated on line 10 and not line 4. The behaviour is correct when we use a leaf instruction (e.g. if we replaced `1.0 / 0.0` with `"hello"`), then the output is: [10, "test.rb"]. [Bug #19456] Notes: Merged: https://github.com/ruby/ruby/pull/7357
2023-02-24[ruby/irb] Cleanup completion testsStan Lo
(https://github.com/ruby/irb/pull/520) * Remove redundant completion test The test case was introduced to guard an old implementation, which relied on `Module#name`. Commit: https://github.com/ruby/irb/commit/8827d182746396dbf4499c2c1c8c0e9bf8375b7c However, the current implementation has avoided calling `Module#name` completely, so the test case is no longer necessary. Commit: https://github.com/ruby/irb/commit/88311ce3c84251e6f420246cd14efc96e00888be * Remove unnecessary pend
2023-02-24[ruby/set] Set#merge does not take keyword arguments as a HashAkinori MUSHA
https://github.com/ruby/set/commit/ca1c9532a9
2023-02-24[ruby/set] Set#merge takes many enumerable objects like Hash#merge! doesAkinori MUSHA
https://github.com/ruby/set/commit/becaca994d
2023-02-23Implement ObjectSpace::WeakKeyMap basic allocatorJean Boussier
[Feature #18498] Notes: Merged: https://github.com/ruby/ruby/pull/5570
2023-02-22Skip failing test on MSWinNobuyoshi Nakada
2023-02-22[rubygems/rubygems] Skip extension test on jrubySamuel Giddins
https://github.com/rubygems/rubygems/commit/38ee82c297
2023-02-22[rubygems/rubygems] Better teardownSamuel Giddins
https://github.com/rubygems/rubygems/commit/5fa0ebf09b
2023-02-22[rubygems/rubygems] Always join with a stringSamuel Giddins
Gem.path_separator can also be a regexp... https://github.com/rubygems/rubygems/commit/7e6e56a5f3
2023-02-22[rubygems/rubygems] Nil out Gem.configuration after testsSamuel Giddins
https://github.com/rubygems/rubygems/commit/3135ad91d4
2023-02-22[rubygems/rubygems] Use assert_raise instead of assert_raisesSamuel Giddins
For ruby-core compat https://github.com/rubygems/rubygems/commit/c8f85c91a8
2023-02-22[rubygems/rubygems] Add tests covering pre-releases for gem execSamuel Giddins
https://github.com/rubygems/rubygems/commit/f6877c29b9
2023-02-22[rubygems/rubygems] Fix resetting env in gem exec, and make sure it is set ↵Samuel Giddins
for gem exec gem https://github.com/rubygems/rubygems/commit/13a6dd4992
2023-02-22[rubygems/rubygems] Allow gem exec gemSamuel Giddins
https://github.com/rubygems/rubygems/commit/a767f7b9be
2023-02-22[rubygems/rubygems] Remove platform option for gem execSamuel Giddins
Also fix native extensions that load dependencies https://github.com/rubygems/rubygems/commit/a06f9870c7
2023-02-22[rubygems/rubygems] Ensure dependencies are updated by default when running ↵Samuel Giddins
gem exec https://github.com/rubygems/rubygems/commit/664f3e1e5f
2023-02-22[rubygems/rubygems] Add specs for gem execSamuel Giddins
https://github.com/rubygems/rubygems/commit/3078e5834e
2023-02-22Removed accidentally commits with ruby/readline-extHiroshi SHIBATA
Partly reverted 1ddda4c0d7d2b83658ab149e36e088961ca0b2dc
2023-02-22[ruby/readline-ext] test_readline.rb only needs EnvUtilHiroshi SHIBATA
https://github.com/ruby/readline-ext/commit/9245965ecd
2023-02-22[ruby/readline-ext] Omit some tests with macOS platformHiroshi SHIBATA
https://github.com/ruby/readline-ext/commit/efe2be6e4c
2023-02-22[ruby/readline-ext] Import EnvUtils and related test librariesHiroshi SHIBATA
https://github.com/ruby/readline-ext/commit/f034697a48
2023-02-21[ruby/irb] Improve RubyLex's testsStan Lo
(https://github.com/ruby/irb/pull/484) * Improve assert_indenting helper Instead of putting assertions inside the `auto_indent` block, we can just make `auto_indent` return the calculated space count, and use it for assertion outside of the `auto_indent` block call. This simplifies the setup code and makes the intention easier to understand. * Introduce assert_row_indenting helper 1. Helper users shouldn't need to write 2 assertions for the current and the next line's indentation. 2. With this new approach, we can generate clearer error message for both cases: When the current line's space count doesn't match ``` Incorrect spaces calculation for line: ``` > def each_top_level_statement ``` All lines: ``` def each_top_level_statement ``` <0> expected but was <nil> ``` When the next line's space count doesn't match ``` Incorrect spaces calculation for line after the current line: ``` def each_top_level_statement > ``` All lines: ``` def each_top_level_statement ``` <3> expected but was <2> ``` * Replace assert_indenting with assert_row_indenting
2023-02-21Add marking and sweeping time to GC.statPeter Zhu
There is a `time` key in GC.stat that gives us the total time spent in GC. However, we don't know what proportion of the time is spent between marking and sweeping. This makes it difficult to tune the GC as we're not sure where to focus our efforts on. This PR adds keys `marking_time` and `sweeping_time` to GC.stat for the time spent marking and sweeping, in milliseconds. [Feature #19437] Notes: Merged: https://github.com/ruby/ruby/pull/7304
2023-02-21[ruby/strscan] Mask out this test on JRuby/WindowsCharles Oliver Nutter
See https://github.com/jruby/jruby/issues/7644 for the root issue, which will require fixes to JRuby's regular expression engine, JOni. https://github.com/ruby/strscan/commit/29a65abff2
2023-02-21[ruby/strscan] test: Run test more with fixed anchor modeSutou Kouhei
(https://github.com/ruby/strscan/pull/60) fix https://github.com/ruby/strscan/pull/56
2023-02-21[ruby/strscan] Add test case to `test_string`OKURA Masafumi
(https://github.com/ruby/strscan/pull/58) `string` returns the original string after `scan` is called. Current test doesn't check this behavior and now it's covered.
2023-02-21[ruby/csv] test: use mailing list ID instead of unavailable URLSutou Kouhei
https://github.com/ruby/csv/commit/04862ccf87
2023-02-21[ruby/csv] Use https links instead of httpVivek Bharath Akupatni
(https://github.com/ruby/csv/pull/274) https://github.com/ruby/csv/commit/e2a06929a8
2023-02-21Merge rubygems/bundler masterHiroshi SHIBATA
Pick from https://github.com/rubygems/rubygems/commit/e9304aed7e43308b99e70c2f7b92028315fee8a5 Notes: Merged: https://github.com/ruby/ruby/pull/7345
2023-02-21[rubygems/rubygems] Bump rb-sysdependabot[bot]
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.64 to 0.9.65. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.64...v0.9.65) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
2023-02-21Prevent "warning: ambiguity between regexp and two divisions"Yusuke Endoh
http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20230221T031004Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20230221T031004Z/ruby/test/rubygems/test_gem_ext_cargo_builder.rb:90: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator ```
2023-02-20YJIT: Fix assertion for partially mapped last pages (#7337)Takashi Kokubun
Follows up [Bug #19400] Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-02-20Update some tests for the new message format of NoMethodErrorYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/6950
2023-02-19test/readline/test_readline.rb: skip a test x86_64-linux-(x32|i[3-6]86)Eric Wong
I run a 32-bit (x86) userspace on a 64-bit kernel to save memory and this test fails for the same reason it does on pure 32-bit platforms. Followup-to: 6cf7c0a48fb07a76 (test/readline/test_readline.rb: skip a test on i686-linux, 2021-11-09)
2023-02-19[ruby/error_highlight] Support the new message format of NameError in Ruby 3.3Yusuke Endoh
https://bugs.ruby-lang.org/issues/18285 https://github.com/ruby/ruby/pull/6950 https://github.com/ruby/error_highlight/commit/a7c2da052e
2023-02-19[ruby/did_you_mean] Support the new message format of NameError inYusuke Endoh
Ruby 3.3 (https://github.com/ruby/did_you_mean/pull/184) This change accepts the following change of the message of NameError in a test. https://bugs.ruby-lang.org/issues/18285#note-37 ``` old: undefined method `sizee' for #<File:...> new: undefined method `sizee' for an instance of File ```
2023-02-17[ruby/bigdecimal] Handle correctly #remainder with infinity. FixesMaciej Rzasa
https://github.com/ruby/bigdecimal/pull/187 https://github.com/ruby/bigdecimal/commit/4b8572d452
2023-02-17[Bug#19445] Fix keyword splat in enumeratorNobuyoshi Nakada
Extracted arguments do not have keyword hash to splat. Notes: Merged: https://github.com/ruby/ruby/pull/7325 Merged-By: nobu <nobu@ruby-lang.org>
2023-02-16YJIT: Fix false assumption that String#+@ => ::StringAlan Wu
Could return a subclass. [Bug #19444] Notes: Merged: https://github.com/ruby/ruby/pull/7328
2023-02-16YJIT: jit_prepare_routine_call() for String#+@ missingAlan Wu
We saw SEGVs due to this when running with StackProf, which needs a correct PC for RUBY_INTERNAL_EVENT_NEWOBJ, the same event used for ObjectSpace allocation tracing. [Bug #19444] Notes: Merged: https://github.com/ruby/ruby/pull/7328
2023-02-15Fix removing ivars from clases and modules.Haldun Bayhantopcu
Co-authored-by: Adam Hess <hparker@github.com> Notes: Merged: https://github.com/ruby/ruby/pull/7314