summaryrefslogtreecommitdiff
path: root/spec/ruby/language
AgeCommit message (Collapse)Author
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-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`.
2024-12-24Postpone spec of eszett with ignore case in look behindNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12455
2024-12-10Update to ruby/spec@9f10222Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12297
2024-11-06Update to ruby/spec@54c391eBenoit Daloze
2024-10-03Update spec/ruby/ for colon-style hash inspecttompng
Notes: Merged: https://github.com/ruby/ruby/pull/10924
2024-07-02Update to ruby/spec@f8987acAndrew Konchin
2024-06-10Update to ruby/spec@517f06fAndrew Konchin
2024-06-06Remove circular parameter syntax errorKevin Newton
https://bugs.ruby-lang.org/issues/20478
2024-05-24Update duplicated when clause warning messageKevin Newton
2024-05-19Update to ruby/spec@6b04c1dAndrew Konchin
2024-04-18chore: remove repetitive words (#10573)careworry
Signed-off-by: careworry <worrycare@outlook.com>
2024-04-11prism_compile.c: X_STRING should be frozenJean Boussier
The backtick method recieves a frozen string unless it is interpolated. Otherwise the string held in the ISeq could be mutated by a custom backtick method.
2024-04-03Reset `$.` before matchingNobuyoshi Nakada
This is a global variable and may happen to be set to 4 elsewhere. http://ci.rvm.jp/logfiles/brlog.trunk.20240403-054356#L1707 ``` The if expression with a boolean range ('flip-flop' operator) warns when Integer literals are used instead of predicates FAILED Expected [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] == [] to be truthy but was false ```
2024-04-02Update to ruby/spec@573cf97Andrew Konchin
2024-03-22[Feature #20275] Remove extra backtrace entries for rescue and ensureBenoit Daloze
2024-03-19Implement chilled stringsÉtienne Barrié
[Feature #20205] As a path toward enabling frozen string literals by default in the future, this commit introduce "chilled strings". From a user perspective chilled strings pretend to be frozen, but on the first attempt to mutate them, they lose their frozen status and emit a warning rather than to raise a `FrozenError`. Implementation wise, `rb_compile_option_struct.frozen_string_literal` is no longer a boolean but a tri-state of `enabled/disabled/unset`. When code is compiled with frozen string literals neither explictly enabled or disabled, string literals are compiled with a new `putchilledstring` instruction. This instruction is identical to `putstring` except it marks the String with the `STR_CHILLED (FL_USER3)` and `FL_FREEZE` flags. Chilled strings have the `FL_FREEZE` flag as to minimize the need to check for chilled strings across the codebase, and to improve compatibility with C extensions. Notes: - `String#freeze`: clears the chilled flag. - `String#-@`: acts as if the string was mutable. - `String#+@`: acts as if the string was mutable. - `String#clone`: copies the chilled flag. Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-03-14Update to ruby/spec@89175b2Benoit Daloze
2024-03-05[DOC] fix some commentscui fliter
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-02-19[Bug #20280] Fix wrong testsNobuyoshi Nakada
2024-02-15ruby-spec: Accept the receiver in backtracesYusuke Endoh
2024-02-15ruby-spec: Accept both a backtick and a single quote in error messagesYusuke Endoh
2024-02-05Update to ruby/spec@3fc4444Benoit Daloze
2023-12-25Re-skip a failing specTakashi Kokubun
2023-12-07Fix keyword splat passing as regular argumentJeremy Evans
Since Ruby 3.0, Ruby has passed a keyword splat as a regular argument in the case of a call to a Ruby method where the method does not accept keyword arguments, if the method call does not contain an argument splat: ```ruby def self.f(obj) obj end def self.fs(*obj) obj[0] end h = {a: 1} f(**h).equal?(h) # Before: true; After: false fs(**h).equal?(h) # Before: true; After: false a = [] f(*a, **h).equal?(h) # Before and After: false fs(*a, **h).equal?(h) # Before and After: false ``` The fact that the behavior differs when passing an empty argument splat makes it obvious that something is not working the way it is intended. Ruby 2 always copied the keyword splat hash, and that is the expected behavior in Ruby 3. This bug is because of a missed check in setup_parameters_complex. If the keyword splat passed is not mutable, then it points to an existing object and not a new object, and therefore it must be copied. Now, there are 3 specs for the broken behavior of directly using the keyword splatted hash. Fix two specs and add a new version guard. Do not keep the specs for the broken behavior for earlier Ruby versions, in case this fix is backported. For the ruby2_keywords spec, just remove the related line, since that line is unrelated to what the spec is testing. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-11-27Update to ruby/spec@c3206f6Benoit Daloze
2023-10-30Update to ruby/spec@bd7017fBenoit Daloze
2023-09-04Update to ruby/spec@96d1072Benoit Daloze
2023-08-02Update to ruby/spec@9e278f5Benoit Daloze
2023-07-24Use the caller location as default filename for eval family of methodsJean Boussier
[Feature #19755] Before (in /tmp/test.rb): ```ruby Object.class_eval("p __FILE__") # => "(eval)" ``` After: ```ruby Object.class_eval("p __FILE__") # => "(eval at /tmp/test.rb:1)" ``` This makes it much easier to track down generated code in case the author forgot to provide a filename argument. Notes: Merged: https://github.com/ruby/ruby/pull/8070
2023-07-19Add tests for `return` in `BEGIN` and `END` blocksNobuyoshi Nakada
2023-06-26Update to ruby/spec@30e1c35Benoit Daloze
2023-05-13fix wording of spec description [ci skip]Martin Dürst
2023-04-25Update to ruby/spec@7f69c86Benoit Daloze
2023-04-20Use ASCII-compatible encoding for testsNobuyoshi Nakada
Since these files are written in a wide character encoding, stop at first NUL byte and are actually empty. ASCII-incompatible encodings have never been supported as source encoding.
2023-02-27Update to ruby/spec@e7dc804Benoit Daloze
2023-01-24Add tests for variables in `END` block shared with the toplevelNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7136
2023-01-05Update to ruby/spec@9d69b95Benoit Daloze
2022-12-26Skip some examples for Ruby 3.3Hiroshi SHIBATA
2022-11-07Update to ruby/spec@740ccc8Benoit Daloze
2022-09-28Update to ruby/spec@1d9d5c6Benoit Daloze
2022-08-29Update to ruby/spec@d01709fBenoit Daloze
2022-07-27Update to ruby/spec@cbfaf51Benoit Daloze
2022-07-21Do not have class/module keywords look up ancestors of ObjectJeremy Evans
Fixes case where Object includes a module that defines a constant, then using class/module keyword to define the same constant on Object itself. Implements [Feature #18832] Notes: Merged: https://github.com/ruby/ruby/pull/6048
2022-06-26Update to ruby/spec@ab32a1aBenoit Daloze
2022-04-25Update to ruby/spec@3affe1eBenoit Daloze
2022-03-30Do not autosplat array in block call just because keywords acceptedJeremy Evans
If the block only accepts a single positional argument plus keywords, then do not autosplat. Still autosplat if the block accepts more than one positional argument in addition to keywords. Autosplatting a single positional argument plus keywords made sense in Ruby 2, since a final positional hash could be used as keywords, but it does not make sense in Ruby 3. Fixes [Bug #18633] Notes: Merged: https://github.com/ruby/ruby/pull/5665 Merged-By: jeremyevans <code@jeremyevans.net>
2022-03-28Update to ruby/spec@aaf998fBenoit Daloze
2022-03-04sitelibdir makes no sense in ruby itselfNobuyoshi Nakada
2022-03-03Update to ruby/spec@82cd3a3Benoit Daloze