summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-07-08[ruby/reline] Ignore unhandled escape sequencestomoya ishida
(https://github.com/ruby/reline/pull/522) * Add unassigned escape sequence matcher to KeyStroke * Do not insert ESC and unassigned ESC+key to input buffer
2023-07-07[ruby/reline] Reduce direct references to `Reline::IOGate`Stan Lo
(https://github.com/ruby/reline/pull/566) * Avoid referencing IOGate from IOGate classes The only time those classes being used is when themselves being the IOGate. So when referencing to IOGate, it's better to use `self` instead. * Avoid referencing to IOGate from LineEditor directly * Avoid referencing to IOGate from Core directly * Reference to Reline.core directly * Replace Reline::IOGate with Reline.core.io_gate
2023-07-06Resync YARP (#8036)Jemma Issroff
It got out of sync again. After this re-sync, it should happen cherry-picking automatically. Notes: Merged-By: jemmaissroff
2023-07-06[rubygems/rubygems] Avoid to use Base64 library because I have a plan to ↵Hiroshi SHIBATA
base64 gem to bundled gems in ruby/ruby. https://github.com/rubygems/rubygems/commit/221797cfd1
2023-07-05Manual YARP resyncJemma Issroff
Notes: Merged: https://github.com/ruby/ruby/pull/8007
2023-07-05[ruby/reline] Update Relin::IOGate dinamically when it is neededtomoya ishida
(https://github.com/ruby/reline/pull/560) https://github.com/ruby/reline/commit/4680d1c9e0
2023-07-05[ruby/bigdecimal] Add .to_s('F') digit grouping for integer partcryptogopher
https://github.com/ruby/bigdecimal/commit/f63544d465
2023-07-05[ruby/reline] Fix wrong byte_pointer passed to auto_indent_proctomoya ishida
(https://github.com/ruby/reline/pull/562) https://github.com/ruby/reline/commit/4348354604
2023-07-05Remove stale YARP snapshort file [ci skip]Nobuyoshi Nakada
2023-07-04[ruby/irb] Refactor eval historyStan Lo
(https://github.com/ruby/irb/pull/623) * Rename `ext/history.rb` to `ext/eval_history.rb` To confusion with `lib/irb/history.rb` * Add eval_history tests * Rename eval_history's History to EvalHistory to avoid confusion
2023-07-03[ruby/irb] Stop treating history-saving logic as extensionStan Lo
(https://github.com/ruby/irb/pull/613) Since `IRB.conf[:SAVE_HISTORY]` is assigned with 1000 by default, history-saving is a feature enabled by default. So it should not be treated as an extension, which adds unnecessary complexity to the code.
2023-07-03[ruby/timeout] Test that work is done in the same thread/fiber asJohn Bachir
the caller (https://github.com/ruby/timeout/pull/34) * see discussion in https://github.com/ruby/timeout/pull/30#issuecomment-1616179651
2023-07-03[ruby/tmpdir] [Bug #18933] Make `Dir.mktmpdir` Ractor-safeNobuyoshi Nakada
Fix https://bugs.ruby-lang.org/issues/18933 https://github.com/ruby/tmpdir/commit/446e636434
2023-06-30Handle unterminated unicode escapes in regexpsJeremy Evans
This fixes an infinite loop possible after ec3542229b29ec93062e9d90e877ea29d3c19472. For \u{} escapes in regexps, skip validation in the parser, and rely on the regexp code to handle validation. This is necessary so that invalid unicode escapes in comments in extended regexps are allowed. Fixes [Bug #19750] Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/8003 Merged-By: jeremyevans <code@jeremyevans.net>
2023-06-30[ruby/irb] Reduce internal operations' exposure to benchmarkingStan Lo
(https://github.com/ruby/irb/pull/618) * Test last value is assigned with measure enabled * Remove unnecessary `result` variable `Context#evaluate` always assigns the result of the evaluation to `_` so we don't need to do it in `Irb#eval_input`. * Move benchmarking logic into `Context#evaluate` Current location of the benchmarking logic is too high up and includes operations like command loading and argument transformation, which should be excluded. So this commit moves it into `Context#evaluate` to reduce the noise. We don't move it further down to `Workspace#evaluate` because `Context` is an argument of the measure block, which is not available in `Workspace`.
2023-06-30[ruby/irb] Re-implement prev_spaces feature for pasted codetomoya ishida
(https://github.com/ruby/irb/pull/607) https://github.com/ruby/irb/commit/9d97a192a5
2023-06-29Fix memory leak in Hash#replacePeter Zhu
Hash#replace can leak memory if the receiver has an ST table. Notes: Merged: https://github.com/ruby/ruby/pull/8001
2023-06-29Add memory leak test for allocating ST hashesPeter Zhu
Test for commit f0d08d11dcd404f3146c0d71d6ff743bbc6e7193.
2023-06-29[ruby/uri] Fix quadratic backtracking on invalid port numberNobuyoshi Nakada
https://hackerone.com/reports/1958260 https://github.com/ruby/uri/commit/9d7bcef1e6
2023-06-29[ruby/uri] Fix quadratic backtracking on invalid relative URINobuyoshi Nakada
https://hackerone.com/reports/1958260 https://github.com/ruby/uri/commit/9010ee2536
2023-06-28Increase memory leak test timeoutPeter Zhu
The test times out on some platforms, so increase the timeout. Notes: Merged: https://github.com/ruby/ruby/pull/7992
2023-06-28[ruby/irb] Reduce test pend trufflerubytomoya ishida
(https://github.com/ruby/irb/pull/619) https://github.com/ruby/irb/commit/b7b071774f
2023-06-28Fix memory leak in RipperPeter Zhu
The following script leaks memory in Ripper: ```ruby require "ripper" 20.times do 100_000.times do Ripper.parse("") end puts `ps -o rss= -p #{$$}` end ``` Notes: Merged: https://github.com/ruby/ruby/pull/7985
2023-06-28[Bug #19748] Fix out-of-bound access in `String#byteindex`Nobuyoshi Nakada
2023-06-28[ruby/csv] Fix a bug that the same line is used multiple timesSutou Kouhei
GitHub: fix https://github.com/ruby/csv/pull/279 It's happen when: * `keep_start`/`keep_{drop,back}` are nested. (e.g.: `strip: true, skip_lines: /.../`) * Row separator is `\r\n`. * `InputScanner` is used. (Small input doesn't use `InputScanner`) Reported by Gabriel Nagy. Thanks!!! https://github.com/ruby/csv/commit/183635ab56
2023-06-28[ruby/fiddle] Add support for more "short" variantsSutou Kouhei
https://github.com/ruby/fiddle/commit/4598e6cd50
2023-06-28[ruby/fiddle] Add support for "long" variantsSutou Kouhei
GitHub: fix https://github.com/ruby/fiddle/pull/100 Reported by David M. Lary. Thanks!!! https://github.com/ruby/fiddle/commit/516333dd78
2023-06-28[ruby/fiddle] Add a helper method for reading/writing memoryAaron Patterson
(https://github.com/ruby/fiddle/pull/123) This commit adds two new methods, `Fiddle::Pointer.read` and `Fiddle::Pointer.write`. Both methods take an address, and will read or write bytes at that address respectively. For example we can read from an address without making a Pointer object: ```ruby Fiddle::Pointer.read(address, 5) # read 5 bytes ``` We can also write to an address without allocating a Pointer object: ```ruby Fiddle::Pointer.write(address, "bytes") # write 5 bytes ``` This allows us to read / write memory at arbitrary addresses without instantiating a new `Fiddle::Pointer` object. Examples where this API would be useful [1](https://github.com/tenderlove/tenderjit/blob/f03481d28bff4d248746e596929b0841de65f181/lib/tenderjit/fiddle_hacks.rb#L26-L28) [2](https://github.com/tenderlove/ruby/blob/77c8daa2d40dd58eeb3785ce17dea2ee38f308d1/lib/ruby_vm/rjit/c_pointer.rb#L193) [3](https://github.com/tenderlove/ruby/blob/77c8daa2d40dd58eeb3785ce17dea2ee38f308d1/lib/ruby_vm/rjit/c_pointer.rb#L284) I also added a writer method for the same reasons as the reader. --------- https://github.com/ruby/fiddle/commit/04238cefed Co-authored-by: Sutou Kouhei <kou@clear-code.com>
2023-06-28[Bug #19746] `String#index` with regexp should clear `$~` unless matchedNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7988
2023-06-28Assert `$~` after `String#index` familyNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7988
2023-06-28Use the same capacities for memory leak testsNobuyoshi Nakada
2023-06-27[ruby/irb] Remove keyword exception from Context#evaluate becausetomoya ishida
the value is always nil (https://github.com/ruby/irb/pull/617) https://github.com/ruby/irb/commit/62691384f8
2023-06-27[ruby/irb] Always add \n at the end of the test input in RubyLextomoya ishida
test (https://github.com/ruby/irb/pull/614) https://github.com/ruby/irb/commit/e68c6128aa
2023-06-26[ruby/yarp] Add missing snapshotHaldun Bayhantopcu
https://github.com/ruby/yarp/commit/08f08a6cc4
2023-06-26Suppress warningsNobuyoshi Nakada
2023-06-26Add the chopsticks code at RubyKaigi2023Nobuyoshi Nakada
2023-06-25[ruby/uri] Fix host part in relative referece #83Nobuyoshi Nakada
In relative referece, host part can be ommitted but can not be empty. https://github.com/ruby/uri/commit/2980f0ba02
2023-06-25[ruby/irb] Fix process_continue(rename to should_continue?) andtomoya ishida
check_code_block(rename to check_code_syntax) (https://github.com/ruby/irb/pull/611) https://github.com/ruby/irb/commit/b7f4bfaaa4
2023-06-24[ruby/irb] Omit nesting_level, use indent_level to build prompttomoya ishida
string (https://github.com/ruby/irb/pull/610) https://github.com/ruby/irb/commit/f01ff0811b
2023-06-24Do not have Enumeratory::Lazy#zip mark result as packedJeremy Evans
Fixes [Bug #19569] Notes: Merged: https://github.com/ruby/ruby/pull/7967
2023-06-24[ruby/yarp] Name test methods from relative pathsNobuyoshi Nakada
Full path name of the source directory is a useless noise as tests. https://github.com/ruby/yarp/commit/44a7ae2e64
2023-06-23Skip test on Solaris SPARCPeter Zhu
This test fails on Solaris SPARC with the following error and I can't figure out why: TestGCCompact#test_moving_hashes_down_size_pools Expected 499 to be >= 500.
2023-06-22[ruby/timeout] Raise exception instead of throw/catch for timeoutsJeremy Evans
(https://github.com/ruby/timeout/pull/30) throw/catch is used for non-local control flow, not for exceptional situations. For exceptional situations, raise should be used instead. A timeout is an exceptional situation, so it should use raise, not throw/catch. Timeout's implementation that uses throw/catch internally causes serious problems. Consider the following code: ```ruby def handle_exceptions yield rescue Exception => exc handle_error # e.g. ROLLBACK for databases raise ensure handle_exit unless exc # e.g. COMMIT for databases end Timeout.timeout(1) do handle_exceptions do do_something end end ``` This kind of design ensures that all exceptions are handled as errors, and ensures that all exits (normal exit, early return, throw/catch) are not handled as errors. With Timeout's throw/catch implementation, this type of code does not work, since a timeout triggers the normal exit path. See https://github.com/rails/rails/pull/29333 for an example of the damage Timeout's design has caused the Rails ecosystem. This switches Timeout.timeout to use raise/rescue internally. It adds a Timeout::ExitException subclass of exception for the internal raise/rescue, which Timeout.timeout will convert to Timeout::Error for backwards compatibility. Timeout::Error remains a subclass of RuntimeError. This is how timeout used to work in Ruby 2.0. It was changed in Ruby 2.1, after discussion in [Bug #8730] (commit https://github.com/ruby/timeout/commit/238c003c921e in the timeout repository). I think the change from using raise/rescue to using throw/catch has caused significant harm to the Ruby ecosystem at large, and reverting it is the most sensible choice. From the translation of [Bug #8730], it appears the issue was that someone could rescue Exception and not reraise the exception, causing timeout errors to be swallowed. However, such code is broken anyway. Using throw/catch causes far worse problems, because then it becomes impossible to differentiate between normal control flow and exceptional control flow. Also related to this is [Bug #11344], which changed how Thread.handle_interrupt interacted with Timeout. https://github.com/ruby/timeout/commit/f16545abe6 Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-06-22[ruby/ipaddr] Consider IPv4-mapped IPv6 addresses private if IPv4 address is ↵Jeremy Evans
private Fixes [Bug #19479] https://github.com/ruby/ipaddr/commit/7faa0768d3
2023-06-22Sync ruby/yarp to ↵Takashi Kokubun
https://github.com/ruby/yarp/commit/89a00203af803032383338c943836da6bafca7d9
2023-06-22[ruby/yarp] Allow for block statements after elsif and elseJemma Issroff
https://github.com/ruby/yarp/commit/4560cab235
2023-06-22Sync ruby/yarp with sync_default_gemsTakashi Kokubun
2023-06-22[Bug #19743] All but EOF can be read again after push-backNobuyoshi Nakada
2023-06-22[rubygems/rubygems] Prefer `assert_include` over mere `assert`Nobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/140405cee6
2023-06-22[rubygems/rubygems] Prefer `assert_predicate` over mere `assert`Nobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/0d10063824