summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2025-02-20Merge RubyGems-3.6.3 and Bundler-2.6.3Hiroshi SHIBATA
2025-02-18[ruby/prism] Fix escape unicode curly inline whitespaceKevin Newton
Fixes [Bug #21145] https://github.com/ruby/prism/commit/be2d845639
2025-02-14Fix locals_test based on previous backportsKevin Newton
2025-02-14Backport Bug #21137Kevin Newton
2025-02-14Backport Bug #21031Kevin Newton
2025-02-13[Bug #20982] Put spaces in `ENV.inspect` results as well as `Hash`Nobuyoshi Nakada
2025-02-13Refine ENV testsNobuyoshi Nakada
2025-02-13merge revision(s) 19c39e4cfaa467e69b9848c9c5496d7f50d39c7f, ↵Takashi Kokubun
d78ff6a767ca813ac5fa178dd7611f20a993c191: [Backport #20984] [Bug #20984] ENV.inspect should be encoding aware [Bug #20984] Fix test with locale encoding
2025-02-13Revert "merge revision(s) cb419e3912f0514b8151469b0a4a4b83cbbcce78: ↵Takashi Kokubun
[Backport #21031]" This reverts commit 7adf89d7ad30552d7e57709d24eec266f601d38b.
2025-02-13merge revision(s) b21e1aed2ed5b22b50efc658289a403eeed581df: [Backport #21114]Takashi Kokubun
[ruby/prism] Fix infinite loop in error recovery When recovering from a depth error that occurs at the end of the file, we need to break out of parsing statements. Fixes [Bug #21114] https://github.com/ruby/prism/commit/a32e268787
2025-02-13merge revision(s) 127325a4bad409ee5da91084fac768934a8fd9e3: [Backport #21117]Takashi Kokubun
[ruby/prism] No writing to numbered parameters Fixes [Bug #21117] https://github.com/ruby/prism/commit/19d4bab5a0
2025-02-13merge revision(s) 1683dadb19876f0a64589bdbbcf6fff8143f78ff: [Backport #21088]Takashi Kokubun
Do not save ResolutionError if resolution succeeds for any address family (#12678) * Do not save ResolutionError if resolution succeeds for any address family Socket with Happy Eyeballs Version 2 performs connection attempts and name resolution in parallel. In the existing implementation, if a connection attempt failed for one address family while name resolution was still in progress for the other, and that name resolution later failed, the method would terminate with a name resolution error. This behavior was intended to ensure that the final error reflected the most recent failure, potentially overriding an earlier error. However, [Bug #21088](https://bugs.ruby-lang.org/issues/21088) made me realize that terminating with a name resolution error is unnatural when name resolution succeeded for at least one address family. This PR modifies the behavior so that if name resolution succeeds for one address family, any name resolution error from the other is not saved. This PR includes the following changes: * Do not display select(2) as the system call that caused the raised error, as it is for internal processing * Fix bug: Get errno with Socket::SO_ERROR in Windows environment with a workaround for tests not passing
2025-02-13merge revision(s) db02a6b3ab4cabbdf492c26dcb1929b4ef0370a1: [Backport #21103]Takashi Kokubun
[Bug #21103] Fix local variable index calculation with forwarding Forwarding argument is optimized not to packed when no other arguments and an internal object refers values before it. This size is decided at called time, calculate the local variable index from the fixed end point.
2025-02-13merge revision(s) e0d600ec190c64aff76cfcbd6009cffb927da166: [Backport #21012]Takashi Kokubun
Avoid opt_aset_with optimization inside multiple assignment Previously, since the opt_aset_with optimization was introduced, use of the opt_aset_with optimization inside multiple assignment would result in a segfault or incorrect instructions. Fixes [Bug #21012] Co-authored-by: Nobuyoshi Nakada <nobu.nakada@gmail.com>
2025-02-13merge revision(s) c2908613368b2ae404d094a15df61d830fc46dc9: [Backport #21048]Takashi Kokubun
[ruby/prism] Fix rescue modifier precedence Fixes [Bug #21048] https://github.com/ruby/prism/commit/07202005cb
2025-02-13merge revision(s) cb419e3912f0514b8151469b0a4a4b83cbbcce78: [Backport #21031]Takashi Kokubun
[PRISM] Handle forwarding inside eval Fixes [Bug #21031]
2025-02-13merge revision(s) b176d4f52e4af67654814dab3e9c5f4bf9170e54: [Backport #21008]Takashi Kokubun
[Bug #21008] Normalize before sum to float After switching to `Float`-mode when summing `Numeric` objects, normalization for `Float` is still needed.
2025-02-13merge revision(s) 8034e9c3d001ca3dff124ab42972684eac8af2ae: [Backport #20995]Takashi Kokubun
[Bug #20995] Protect `IO.popen` block from exiting by exception
2025-02-13merge revision(s) 63723c8d5908569918fb27e070ae5bc9de33c8bd: [Backport #21014]Takashi Kokubun
Correctly set node_id on iseq location The iseq location object has a slot for node ids. parse.y was correctly populating that field but Prism was not. This commit populates the field with the ast node id for that iseq [Bug #21014]
2025-02-13merge revision(s) 5fec9308320e8b377681ef19b0cd46d53f94e8ac, ↵Takashi Kokubun
1a06bee027d5c5b65ed0aaee76ee0040554d4efd: [Backport #20992] [Bug #20992] Test for local variable name encodings Do not intern invalid symbols in eval parse When the inner code cannot represent the name of the locals in the outer code, do not bother putting them into the constant pool as they will not be referenced. Fixes [Bug #20992] Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2025-02-13merge revision(s) ad96c5a72908042489357b73dc936c4bc38d919b, ↵Takashi Kokubun
ca81142eff98cccb03ff523322aefe4e7346fd0e: [Backport #21010] [ruby/prism] Throw syntax error for endless method with `[]=` Prism shoudld throw a syntax error for endless methods when the method name uses brackets. Previously it would not. This matches the behavior of parse.y. Fixes https://bugs.ruby-lang.org/issues/21010 https://github.com/ruby/prism/commit/43c16a89ef [ruby/prism] [Bug #21010] Reject endless method definition of `[]=` Fixes: https://bugs.ruby-lang.org/issues/20785 https://github.com/ruby/prism/commit/192960ce5d
2025-02-13merge revision(s) 31905d9e23ec6d1fa2a52f1ef2533f2056e7c9fb: [Backport #21001]Takashi Kokubun
Allow escaping from ensures through next Fixes [Bug #21001]
2025-02-13merge revision(s) 2a1cff40f5e7875f69a7d0ed59eab92cc86c65ff: [Backport #21003]Takashi Kokubun
Do not warn unused block when using forwarding Fixes [Bug #21003]
2025-02-13merge revision(s) fb18bb183c24ca82b8f114ed090d62bd69b5df84: [Backport #20989]Takashi Kokubun
[Bug #20989] Ripper: Pass `compile_error` For the universal parser, `rb_parser_reg_fragment_check` function is shared between the parser and ripper. However `parser_params` struct is partially different, and `compile_error` function depends on that part indirectly.
2025-02-13YJIT: Fix crash when yielding keyword argumentsAlan Wu
Previously, the code for dropping surplus arguments when yielding into blocks erroneously attempted to drop keyword arguments when there is in fact no surplus arguments. Fix the condition and test that supplying the exact number of keyword arguments as require compiles without fallback.
2024-12-24Win32: Defer change of timezone name encoding after 3.4Nobuyoshi Nakada
This change will be merged into 3.5 along with other encoding, command line, environment variables, etc. Revert following commits: - bd831bcca534955533d9135d8c2f22d7ae5b9aa8 [Bug #20929] Win32: Use `wcsftime` - 1c15f641cc2bb88fa88123a11036ed58fbf9aa6d [Bug #20929] Win32: Encode timezone name in UTF-8 - 78762b52185aa80ee55c0d49b495aceed863dce2 [Bug #20929] Fix `assert_zone_encoding` Notes: Merged: https://github.com/ruby/ruby/pull/12448
2024-12-24Fix calls to require_internal in multi-ractor modelukeg
After a ractor is started (multi-ractor mode), any calls to require_internal will hang the process due to deadlock. For example, loading a new encoding will deadlock after a ractor starts. Fixes [Bug #19562] Notes: Merged: https://github.com/ruby/ruby/pull/7656
2024-12-24Merge RubyGems-3.6.2 and Bundler-2.6.2David Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/12444
2024-12-23[Bug #20978] Stringize Fiber storage keysNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12438
2024-12-23Add a test case for nested block `it`yui-knk
Notes: Merged: https://github.com/ruby/ruby/pull/12435
2024-12-23Revert "[Bug #20965] Define `it` like an ordinary argument" (#12418)Takashi Kokubun
Revert "[Bug #20965] Define `it` like an ordinary argument (#12398)" Reverts ruby/ruby#12398 as per https://bugs.ruby-lang.org/issues/20970#note-6 and https://bugs.ruby-lang.org/issues/20965#note-7. We need more time to design the intended behavior, and it's too late for Ruby 3.4. Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2024-12-23Omit TestEval#test_outer_local_variable_under_gc_compact_stress with s390xHiroshi SHIBATA
2024-12-22[ruby/openssl] ssl: fix flaky test case ↵Kazuki Yamaguchi
test_ctx_client_session_cb_tls13_exception In the test case, the client raises an exception in the session_new_cb and may not cleanly close the connection. Let's ignore exceptions raised at the server side. Fixes: https://github.com/ruby/openssl/issues/828 https://github.com/ruby/openssl/commit/210ba0334a Notes: Merged: https://github.com/ruby/ruby/pull/12421
2024-12-22[ruby/openssl] cipher: make output buffer String independentKazuki Yamaguchi
OpenSSL::Cipher#update accepts a String as the second argument to be used as the output buffer. The buffer must be directly writable, in other words, it must not be frozen and not a shared string. rb_str_resize() does not make the String independent if the String already has the intended length. Use the rb_str_modify() family instead to check it. Fixes: https://bugs.ruby-lang.org/issues/20937 https://github.com/ruby/openssl/commit/1de3b80a46 Notes: Merged: https://github.com/ruby/ruby/pull/12421
2024-12-22[ruby/openssl] pkcs12: add PKCS12#set_macKazuki Yamaguchi
Add a binding for PKCS12_set_mac() to set MAC parameters and (re-)calculate MAC for the content. This allows generating PKCS #12 with consistent MAC parameters with different OpenSSL versions. OpenSSL 3.0 changed the default hash function used for HMAC and the KDF from SHA-1 to SHA-256. Fixes: https://github.com/ruby/openssl/issues/772 https://github.com/ruby/openssl/commit/f5ed2a74b6 Notes: Merged: https://github.com/ruby/ruby/pull/12421
2024-12-20Provide Ractor support for **Kevin Newton
Fixes [Bug #20916] Notes: Merged: https://github.com/ruby/ruby/pull/12417
2024-12-20Fix GC compaction crash when using local variables in evalPeter Zhu
If we have local variables outside of the eval, the local variables names are IDs. We convert these IDs to char * using rb_id2name. However, these char * are actually Ruby strings, which may be embedded. This means that it is not safe to rb_id2name and call any potential GC entrypoints because if a GC compaction runs, the embedded string may move and the pointer will change. For example, if you compile with `-DRGENGC_CHECK_MODE=1`, then the following script will crash: GC.auto_compact = :empty GC.stress = true o = Object.new eval("def o.m(k: 0) k end") The crash message is: test.rb:6: [BUG] Local with constant_id 1 does not exist ruby 3.4.0dev (2024-12-17T18:34:57Z prism-local-compac.. 434346726c) +PRISM [arm64-darwin24] -- C level backtrace information ------------------------------------------- miniruby(rb_print_backtrace+0x24) [0x10312fec4] vm_dump.c:823 miniruby(rb_print_backtrace) (null):0 miniruby(rb_vm_bugreport+0x2d4) [0x1031301b8] vm_dump.c:1155 miniruby(rb_bug_without_die_internal+0xa8) [0x102dd6a94] error.c:1097 miniruby(rb_bug+0x28) [0x102dd6b00] error.c:1115 miniruby(pm_lookup_local_index+0xec) [0x102d61e4c] prism_compile.c:1237 miniruby(pm_compile_node+0x45d0) [0x102d252f4] prism_compile.c:9334 miniruby(pm_compile_node+0x1864) [0x102d22588] prism_compile.c:8650 miniruby(pm_compile_node+0x65ec) [0x102d27310] prism_compile.c:9897 miniruby(pm_compile_scope_node+0x3008) [0x102d77bcc] prism_compile.c:6584 miniruby(pm_compile_node+0x5ec4) [0x102d26be8] prism_compile.c:9768 miniruby(pm_iseq_compile_node+0xac) [0x102d20bf0] prism_compile.c:10069 miniruby(pm_iseq_new_with_opt_try+0x2c) [0x102e7d088] iseq.c:1029 miniruby(rb_protect+0x108) [0x102dea9bc] eval.c:1033 miniruby(pm_iseq_new_with_opt+0x264) [0x102e7c444] iseq.c:1082 miniruby(pm_iseq_new_eval+0xec) [0x102e7c8e0] iseq.c:961 miniruby(pm_eval_make_iseq+0x594) [0x1031209cc] vm_eval.c:1770 miniruby(eval_make_iseq+0x54) [0x103120068] vm_eval.c:1799 Notes: Merged: https://github.com/ruby/ruby/pull/12374
2024-12-20[PRISM] Treat it as a local when compiling patternsMatt Valentine-House
Fixes [Bug #20973] Notes: Merged: https://github.com/ruby/ruby/pull/12408
2024-12-20[PRISM] Fix compiling popped opt_str_uminus and opt_str_freezeKazuki Yamaguchi
Put a pop as needed. This example currently causes [BUG]: $ ruby --parser=prism -e'1.times{"".freeze;nil}' -e:1: [BUG] Stack consistency error (sp: 15, bp: 14) ruby 3.4.0dev (2024-12-20T00:48:01Z master 978df259ca) +PRISM [x86_64-linux] Notes: Merged: https://github.com/ruby/ruby/pull/12410
2024-12-20Fix tests for fast_fallback (#12406)Misaki Shioi
* TCPSocket.new: Close resources in ensure * TCPSocket.new: Remove unnecessary comments * Socket.tcp: Make assert_separately in TestSocket more readable * Socket.tcp: Returning instead of exiting * Socket.tcp: Close resources in ensure * Socket.tcp: Avoid test failures on hosts that only support IPv4 Notes: Merged-By: shioimm <shioi.mm@gmail.com>
2024-12-19ruby2_keywords warnings: Quote non-UTF8 method names fullyAlan Wu
It used to quote only part of the method name because NUL byte in the method terminates the C string: ``` (irb)> "abcdef".encode("UTF-16LE").bytes => [97, 0, 98, 0, 99, 0, 100, 0, 101, 0, 102, 0] ``` ``` expected: /abcdef/ actual: warning: Skipping set of ruby2_keywords flag for a (method not defined in Ruby)\n". ``` Notes: Merged: https://github.com/ruby/ruby/pull/12396 Merged-By: XrXr
2024-12-19[Bug #20969] Pass `assignable` from ripperNobuyoshi Nakada
For the universal parser, `rb_reg_named_capture_assign_iter_impl` function is shared between the parser and ripper. However `parser_params` struct is partially different, and `assignable` function depends on that part indirectly. Notes: Merged: https://github.com/ruby/ruby/pull/12400
2024-12-18[Bug #20965] Define `it` like an ordinary argument (#12398)Nobuyoshi Nakada
Also fixes [Bug #20955] Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2024-12-17[ruby/rdoc] Enable cross reference in codeNobuyoshi Nakada
(https://github.com/ruby/rdoc/pull/1240) Some people like to mark up method names in MarkDown style block quotes, like this: ruby/ruby#12333. Currently, no links are created in the code in the RDoc, but such words most likely refer to methods. This PR makes a word a code cross-reference if the whole word can be resolved as a reference. https://github.com/ruby/rdoc/commit/7d7efb0709
2024-12-17[ruby/rdoc] Update tests for ruby/rdoc#1247Stan Lo
(https://github.com/ruby/rdoc/pull/1248) https://github.com/ruby/rdoc/commit/94b9858000
2024-12-17[PRISM] Recurse use_deconstructed_cache in Alternation NodesMatt Valentine-House
This fixes the behavioural difference between Prism and parse.y when evaluating the following code ```ruby 1 in [1 | [1]] ``` Fixes [Bug #20956] Notes: Merged: https://github.com/ruby/ruby/pull/12370
2024-12-17Fix indent rule by rubygems/bundler copsHiroshi SHIBATA
2024-12-16[ruby/rdoc] Print warnings for rdoc-ref links that can't be resolvedStan Lo
(https://github.com/ruby/rdoc/pull/1241) https://github.com/ruby/rdoc/commit/4a5206ae56
2024-12-16[rubygems/rubygems] Fix `gem info` tagging some non default gems as defaultDavid Rodríguez
https://github.com/rubygems/rubygems/commit/7585825c57
2024-12-16[rubygems/rubygems] Improve indentation of a `gem info` testDavid Rodríguez
https://github.com/rubygems/rubygems/commit/b0a092dac3