summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string
AgeCommit message (Collapse)Author
2025-06-02Update to ruby/spec@4d2fc4dAndrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/13495
2025-05-16"binary" is not valid encoding name in EmacsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/13361
2025-05-09Update to ruby/spec@d8bacefAndrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/13265
2025-03-27Update to ruby/spec@5e579e2Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12984
2025-03-04Move in-place interning spec to Ruby's testsJean Boussier
Fix: https://github.com/ruby/spec/issues/1249 JRuby and TruffleRuby can't implement this behavior. While quite a lot of code out there relies on it, if it's not implemented it will simply result in sligthly less efficient code, so not the end of the world. Notes: Merged: https://github.com/ruby/ruby/pull/12850
2025-01-30Update to ruby/spec@affef93Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12679
2024-12-10Update to ruby/spec@9f10222Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12297
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é <[email protected]> --------- Co-authored-by: Étienne Barrié <[email protected]> Co-authored-by: Jean Boussier <[email protected]>
2024-11-06Update to ruby/spec@54c391eBenoit Daloze
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-03Update spec/ruby/ for colon-style hash inspecttompng
Notes: Merged: https://github.com/ruby/ruby/pull/10924
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-07-24Add "c_long_size" guard, supplanting "wordsize" and stop using Integer#sizeAlan Wu
What a "word" is when talking about sizes is confusing because it's a highly overloaded term. Intel, Microsoft, and GDB are just a few vendors that have their own definition of what a "word" is. Specs that used the "wordsize" guard actually were mostly testing for the size of the C `long` fundamental type, so rename the guard for clarity. Also, get the size of `long` directly from RbConfig instead of guessing using Integer#size. Integer#size is not guaranteed to have anything to do with the `long` type. Notes: Merged: https://github.com/ruby/ruby/pull/11130
2024-07-02Update to ruby/spec@f8987acAndrew Konchin
2024-05-29[Bug #20438] Disallow "%\n" and "%\0"Nobuyoshi Nakada
2024-05-28Stop marking chilled strings as frozenÉtienne Barrié
They were initially made frozen to avoid false positives for cases such as: str = str.dup if str.frozen? But this may cause bugs and is generally confusing for users. [Feature #20205] Co-authored-by: Jean Boussier <[email protected]>
2024-05-09Add a ruby_bug spec for String#index clearing $~Jean Boussier
[Bug #20421] The bug was fixed in Ruby 3.3 via 9dcdffb8bf8a3654fd78bf1a58b30c8e13888a7a
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 <[email protected]>
2024-03-14Update to ruby/spec@89175b2Benoit Daloze
2024-02-26Update to ruby/spec@3a510bbBenoit Daloze
2024-02-05Update to ruby/spec@3fc4444Benoit Daloze
2023-10-30Update to ruby/spec@bd7017fBenoit Daloze
2023-08-26[Bug #19784] Fix behaviors against prefix with broken encodingNobuyoshi Nakada
- String#start_with? - String#delete_prefix - String#delete_prefix! Notes: Merged: https://github.com/ruby/ruby/pull/8296
2023-08-02Update to ruby/spec@9e278f5Benoit Daloze
2023-07-15[Bug #19769] Fix range of size 1 in `String#tr`alexandre184
Notes: Merged: https://github.com/ruby/ruby/pull/8080 Merged-By: nobu <[email protected]>
2023-06-26Update to ruby/spec@30e1c35Benoit Daloze
2023-05-29Update to ruby/spec@c3677cfBenoit Daloze
2023-04-25Update to ruby/spec@7f69c86Benoit Daloze
2023-02-27Update to ruby/spec@e7dc804Benoit Daloze
2023-01-05* remove trailing spaces, append newline at EOF. [ci skip]git
2023-01-05Update to ruby/spec@9d69b95Benoit Daloze
2022-12-02[Bug #19087] Merge to "trailing garbage" caseNobuyoshi Nakada
2022-12-02[Bug #19087] Fix an assertion of `String#to_c`Nobuyoshi Nakada
2022-11-24Make String#rstrip{,!} raise Encoding::CompatibilityError for broken coderangeJeremy Evans
It's questionable whether we want to allow rstrip to work for strings where the broken coderange occurs before the trailing whitespace and not after, but this approach is probably simpler, and I don't think users should expect string operations like rstrip to work on broken strings. In some cases, this changes rstrip to raise Encoding::CompatibilityError instead of ArgumentError. However, as the problem is related to an encoding issue in the receiver, and due not due to an issue with an argument, I think Encoding::CompatibilityError is the more appropriate error. Fixes [Bug #18931] Notes: Merged: https://github.com/ruby/ruby/pull/6282
2022-11-07Update to ruby/spec@740ccc8Benoit Daloze
2022-09-28Update to ruby/spec@1d9d5c6Benoit Daloze
2022-08-20[Bug #18955] format single character for `%c`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6258
2022-07-27Update to ruby/spec@cbfaf51Benoit Daloze
2022-06-26Update to ruby/spec@ab32a1aBenoit Daloze
2022-05-20[Feature #18595] Alias String#-@ as String#dedupJean Boussier
Notes: Merged: https://github.com/ruby/ruby/pull/5583
2022-04-25Update to ruby/spec@3affe1eBenoit Daloze
2022-04-17Fix a typoKazuhiro NISHIYAMA
2022-03-28Update to ruby/spec@aaf998fBenoit Daloze
2022-03-03Update to ruby/spec@82cd3a3Benoit Daloze
2022-01-28Update to ruby/spec@902ab83Benoit Daloze
2022-01-10Update to ruby/spec@226cfdcBenoit Daloze
2021-11-29Update to ruby/spec@7f22a0bBenoit Daloze
2021-10-28Update to ruby/spec@21a48d9Benoit Daloze
2021-10-26pack.c: add an offset argument to unpack and unpack1Jean Boussier
[Feature #18254] This is useful to avoid repeteadly copying strings when parsing binary formats
2021-10-05Update to ruby/spec@ccf0d85Benoit Daloze