summaryrefslogtreecommitdiff
path: root/spec/ruby
AgeCommit message (Collapse)Author
2025-12-08Interpolation with only string literals must not be frozenEarlopain
Basically a redo of https://github.com/ruby/ruby/commit/a1403fb7cbd1fe0df97c932be9814c86081783dc but respecting the frozen string literal magic comment Fixes [Bug #21187]
2025-12-08merge revision(s) c5bd4acd30320a8e180ce9fcb24acdab4e10c73a: [Backport #21666]Takashi Kokubun
[PATCH] [Bug #21666] Get rid of use of unspecified values
2025-11-06[Backport #13671] Fix that "ss" in look-behind causes syntax errorK.Takata
Fixes k-takata/Onigmo#92. This fix was ported from oniguruma: https://github.com/kkos/oniguruma/commit/257082dac8c6019198b56324012f0bd1830ff4ba https://github.com/k-takata/Onigmo/commit/b1a5445fbeba97b3e94a733c2ce11c033453af73
2025-10-07Update rubyspec as of CVE-2025-27221Nobuyoshi Nakada
2025-08-27Make word prop match join_control to conform to UTS 18Janosch Müller
See <https://bugs.ruby-lang.org/issues/19417#note-3>. https://unicode.org/reports/tr18/#word states word should match join_control chars. It did not previously: ```ruby [*0x0..0xD799, *0xE000..0x10FFFF].map { |n| n.chr 'utf-8' } => all_chars all_chars.grep(/\p{join_control}/) => jc jc.count # => 2 jc.grep(/\p{word}/).count # => 0 ``` [Backport #19417] --- Backporting note: I regenerated `enc/unicode/15.0.0/name2ctype.h` using `make update-unicode`.
2025-08-27Do not respect ruby2_keywords on method/proc with post argumentsJeremy Evans
Previously, ruby2_keywords could be used on a method or proc with post arguments, but I don't think the behavior is desired: ```ruby def a(*c, **kw) [c, kw] end def b(*a, b) a(*a, b) end ruby2_keywords(:b) b({foo: 1}, bar: 1) ``` This changes ruby2_keywords to emit a warning and not set the flag on a method/proc with post arguments. While here, fix the ruby2_keywords specs for warnings, since they weren't testing what they should be testing. They all warned because the method didn't accept a rest argument, not because it accepted a keyword or keyword rest argument. [Backport #21402]
2025-07-14merge revision(s) 097d742a1ed53afb91e83aef01365d68b763357b: [Backport #20009]Takashi Kokubun
[Bug #20009] Support marshaling non-ASCII name class/module
2025-03-20[Bug #21094] Update nested module names when setting temporary nameNobuyoshi Nakada
[Backport #21094]
2025-03-13Check LoadError firstNobuyoshi Nakada
The message from dlerror is not our concern.
2025-03-13Added assertion strings with Xcode 16.3 betaHiroshi SHIBATA
2025-02-13[Bug #20982] Put spaces in `ENV.inspect` results as well as `Hash`Nobuyoshi Nakada
2025-02-13merge revision(s) 46b544c54955348ef1ea9692b837b061f59f91cd, ↵Takashi Kokubun
d3abee739f4feb91bb9aaae33877d70c8c576db0: [Backport #21095] Prefer `uname -n` over `hostname`. (#12647) Add fallback for `hostname` if `uname` isn't available. (#12655)
2024-12-24Postpone spec of eszett with ignore case in look behindNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12455
2024-12-23[Bug #20978] Use `ruby_bug` instead of `ruby_version_is`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12438
2024-12-23[Bug #20978] Stringize Fiber storage keysNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12438
2024-12-22Suppress WIN32OLE deprecation warnings for the time beingNobuyoshi Nakada
2024-12-10Fix formatting of spec/ruby/optional/capi/ext/hash_spec.cAndrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12297
2024-12-10Update to ruby/spec@9f10222Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12297
2024-12-03Socket#connect may be raise ECONNREFUSEDKazuhiro NISHIYAMA
On my environment with `sudo ufw default reject outgoing`, outgoing packets are filtered without allow rules. Notes: Merged: https://github.com/ruby/ruby/pull/12238
2024-11-29Warn when redefining __id__ as well as object_idJohn Hawthorn
[Feature #20912] Notes: Merged: https://github.com/ruby/ruby/pull/12177
2024-11-21Omit flaky example with Windows platformHiroshi SHIBATA
https://github.com/ruby/ruby/actions/runs/11948300522/job/33305664284?pr=12139 ``` IO#wait [events, timeout] passed changes thread status to 'sleep' when waits for WRITABLE event FAILED Expected false == "sleep" to be truthy but was false D:/a/ruby/ruby/src/spec/ruby/library/io-wait/wait_spec.rb:99:in 'block (3 levels) in <top (required)>' D:/a/ruby/ruby/src/spec/ruby/library/io-wait/wait_spec.rb:8:in '<top (required)>' ``` Notes: Merged: https://github.com/ruby/ruby/pull/12140
2024-11-19[Bug #20900] Warn deprecated constant when removingNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12114
2024-11-14Include the currently active GC in RUBY_DESCRIPTIONMatt Valentine-House
This will add +MOD_GC to the version string and Ruby description when Ruby is compiled with shared gc support. When shared GC support is compiled in and a GC module has been loaded using RUBY_GC_LIBRARY, the version string will include the name of the currently active GC as reported by the rb_gc_active_gc_name function in the form +MOD_GC[gc_name] [Feature #20794] Notes: Merged: https://github.com/ruby/ruby/pull/11872
2024-11-13Mark strings returned by Symbol#to_s as chilled (#12065)Jean byroot Boussier
* Use FL_USER0 for ELTS_SHARED This makes space in RString for two bits for chilled strings. * Mark strings returned by `Symbol#to_s` as chilled [Feature #20350] `STR_CHILLED` now spans on two user flags. If one bit is set it marks a chilled string literal, if it's the other it marks a `Symbol#to_s` chilled string. Since it's not possible, and doesn't make much sense to include debug info when `--debug-frozen-string-literal` is set, we can't include allocation source, but we can safely include the symbol name in the warning message, making it much easier to find the source of the issue. Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com> --------- Co-authored-by: Étienne Barrié <etienne.barrie@gmail.com> Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2024-11-08Do not round `a**b` to infinityYusuke Endoh
... instead, just calculate the value unless it is too big. Also, this change raises an ArgumentError if it is expected to exceed 16 GB in a 64-bit environment. (It is possible to calculate it straightforward, but it would likely be out-of-memory, so I didn't think it would make sense.) [Feature #20811] Notes: Merged: https://github.com/ruby/ruby/pull/12033
2024-11-07Quarantine unreliable specBenoit Daloze
* See discussion on https://github.com/ruby/spec/pull/1210
2024-11-07Loosen the criteria for timing checks of Kernel#sleepYusuke Endoh
The test was too flaky
2024-11-06Update to ruby/spec@54c391eBenoit Daloze
2024-11-06macOS 15 is the stable version todayHiroshi SHIBATA
2024-11-06Assert newly added warning in `JSON.load`Nobuyoshi Nakada
2024-11-04YJIT: Replace Array#each only when YJIT is enabled (#11955)Takashi Kokubun
* YJIT: Replace Array#each only when YJIT is enabled * Add comments about BUILTIN_ATTR_C_TRACE * Make Ruby Array#each available with --yjit as well * Fix all paths that expect a C location * Use method_basic_definition_p to detect patches * Copy a comment about C_TRACE flag to compilers * Rephrase a comment about add_yjit_hook * Give METHOD_ENTRY_BASIC flag to Array#each * Add --yjit-c-builtin option * Allow inconsistent source_location in test-spec * Refactor a check of BUILTIN_ATTR_C_TRACE * Set METHOD_ENTRY_BASIC without touching vm->running Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2024-10-23Harden the ObjectSpace.memsize_of specJean Boussier
[Bug #20803] `abc` is used a lot across the ruby spec suite, if another test runs before this spec is loaded and create this symbol dynamically (`"abc".to_sym`) the spec will fail. So it's preferable to use a symbol name that is very unlikely to be used elsewhere to avoid flakes. Notes: Merged: https://github.com/ruby/ruby/pull/11942
2024-10-21Show where mutated chilled strings were allocatedÉtienne Barrié
[Feature #20205] The warning now suggests running with --debug-frozen-string-literal: ``` test.rb:3: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information) ``` When using --debug-frozen-string-literal, the location where the string was created is shown: ``` test.rb:3: warning: literal string will be frozen in the future test.rb:1: info: the string was created here ``` When resurrecting strings and debug mode is not enabled, the overhead is a simple FL_TEST_RAW. When mutating chilled strings and deprecation warnings are not enabled, the overhead is a simple warning category enabled check. Co-authored-by: Jean Boussier <byroot@ruby-lang.org> Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Jean Boussier <byroot@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/11893
2024-10-15[Bug #20797] Yet another testNobuyoshi Nakada
2024-10-14[Bug #20797] Check seconds in UTC offset as well as minutesNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11892
2024-10-12Support `IO#timeout` for `rsock_connect`. (#11880)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2024-10-05[Bug #20705] Update `strtod` implementationNobuyoshi Nakada
The absence of either the integer or fractional part should be allowed. Notes: Merged: https://github.com/ruby/ruby/pull/11807
2024-10-04Update `io_spec.c` to use `rb_io_maybe_wait*` if possible. (#11792)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2024-10-04Better handling of timeout in `rb_io_maybe_wait_*`. (#9531)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2024-10-03Update spec/ruby/ for colon-style hash inspecttompng
Notes: Merged: https://github.com/ruby/ruby/pull/10924
2024-10-01Define RactorLocalSingleton on .mspec.constantsHiroshi SHIBATA
2024-10-01Temporary disabled RactorLocalSingleton from constant leak check.Hiroshi SHIBATA
2024-09-23Add anonymous module name spec.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/7968
2024-09-18Update exception message in string_for_symbolJeremy Evans
This is a static function only called in two places (rb_to_id and rb_to_symbol), and in both places, both symbols and strings are allowed. This makes the error message consistent with rb_check_id and rb_check_symbol. Fixes [Bug #20607] Notes: Merged: https://github.com/ruby/ruby/pull/11097
2024-09-17Skip failing examples related with ↵Hiroshi SHIBATA
https://github.com/ruby/ruby/commit/d81b0588bb3c97167d1f7e2d2a74185e0c19b68c
2024-09-09Implement String#append_as_bytes(String | Integer, ...)Jean Boussier
[Feature #20594] A handy method to construct a string out of multiple chunks. Contrary to `String#concat`, it doesn't do any encoding negociation, and simply append the content as bytes regardless of whether this result in a broken string or not. It's the caller responsibility to check for `String#valid_encoding?` in cases where it's needed. When passed integers, only the lower byte is considered, like in `String#setbyte`. Notes: Merged: https://github.com/ruby/ruby/pull/11552
2024-09-06Implement Array#fetch_valuesJean Boussier
[Feature #20702] Works the same way than `Hash#fetch_values` for for array. Notes: Merged: https://github.com/ruby/ruby/pull/11557
2024-09-05Move Time#xmlschema in core and optimize itJean Boussier
[Feature #20707] Converting Time into RFC3339 / ISO8601 representation is an significant hotspot for applications that serialize data in JSON, XML or other formats. By moving it into core we can optimize it much further than what `strftime` will allow. ``` compare-ruby: ruby 3.4.0dev (2024-08-29T13:11:40Z master 6b08a50a62) +YJIT [arm64-darwin23] built-ruby: ruby 3.4.0dev (2024-08-30T13:17:32Z native-xmlschema 34041ff71f) +YJIT [arm64-darwin23] warming up...... | |compare-ruby|built-ruby| |:-----------------------|-----------:|---------:| |time.xmlschema | 1.087M| 5.190M| | | -| 4.78x| |utc_time.xmlschema | 1.464M| 6.848M| | | -| 4.68x| |time.xmlschema(6) | 859.960k| 4.646M| | | -| 5.40x| |utc_time.xmlschema(6) | 1.080M| 5.917M| | | -| 5.48x| |time.xmlschema(9) | 893.909k| 4.668M| | | -| 5.22x| |utc_time.xmlschema(9) | 1.056M| 5.707M| | | -| 5.40x| ``` Notes: Merged: https://github.com/ruby/ruby/pull/11510
2024-09-03Range#step: restore legacy behavior for String rangeszverok
Notes: Merged: https://github.com/ruby/ruby/pull/11454
2024-08-18Make Range#step to consistently use + for iteration (#7444)Victor Shepelev
Make Range#step to consistently use + for iteration [Feature #18368] Previously, non-numerics expected step to be integer, and iterated with begin#succ, skipping over step value steps. Since this commit, numeric and non-numeric iteration behaves the same way, by using + operator. Notes: Merged-By: zverok <zverok.offline@gmail.com>