summaryrefslogtreecommitdiff
path: root/spec/ruby
AgeCommit message (Collapse)Author
2024-07-02Update to ruby/spec@f8987acAndrew Konchin
2024-06-25Allow ambiguosity of `return` lineNobuyoshi Nakada
2024-06-25[Bug #20457] Do not remove final `return` nodeNobuyoshi Nakada
This was an optimization for versions prior to 1.9 that traverse the AST at runtime.
2024-06-20Skip 3 specs when $HOME is not a valid directoryJeremy Evans
If $HOME isn't a valid directory, these specs fail, but I think it is better to skip in this case, as it does not indicate a bug. This fixes specs when run in the OpenBSD port, which sets $HOME to an invalid directory to ensure that software's build system is not accidentally relying on it.
2024-06-18net-ftp-0.3.6 always return response with put/puttextfile.Hiroshi SHIBATA
* https://github.com/ruby/net-ftp/pull/34 * https://github.com/ruby/net-ftp/issues/36
2024-06-12Kernel#warn: don't call `Warning.warn` unless the category is enabledJean Boussier
[Bug #20573] Followup: https://github.com/ruby/ruby/pull/10960 I believe `Kernel#warn` should behave in the same way than internal `rb_warning_* APIs
2024-06-12'SPEC_TEMP_DIR` should not be world-writableKoichi Sasada
`SPEC_TEMP_DIR` is not present until `tmp()` method is called on parallel run. In this case `tmp()` is called with `File.umask = 0`. This patch makes `SPEC_TEMP_DIR` before `File.umask = 0`. To solve the issue essentially, I think `SPEC_TEMP_DIR` should be prepared at the beginning of parallel process.
2024-06-10Fix CI when YJIT is enabledAndrew Konchin
2024-06-10Update to ruby/spec@517f06fAndrew Konchin
2024-06-10Check current file on TracePointKoichi Sasada
``` 1) TracePoint#inspect returns a String showing the event, method, path and line for a :call event FAILED Expected "#<TracePoint:call 'call' /tmp/ruby/src/trunk/spec/ruby/core/objectspace/define_finalizer_spec.rb:33>" =~ /\A#<TracePoint:call [`']trace_point_spec_test_call' \/tmp\/ruby\/src\/trunk\/spec\/ruby\/core\/tracepoint\/inspect_spec.rb:43>\z/ to be truthy but was nil ``` This kind of failures comes because of finaizers. So check the current file or not.
2024-06-07Balance block braces with `#if`Nobuyoshi Nakada
2024-06-07Enclose in ruby_version_is blocksNobuyoshi Nakada
2024-06-07Remove the old untyped Data API in spec/rubyNobuyoshi Nakada
2024-06-06Remove circular parameter syntax errorKevin Newton
https://bugs.ruby-lang.org/issues/20478
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-24Update duplicated when clause warning messageKevin Newton
2024-05-19Update to ruby/spec@6b04c1dAndrew Konchin
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-05-02Reject empty lines in IRB binding specStan Lo
For that particular spec, the empty lines' presence is not relevant. So let's remove them to make the spec easier to maintain.
2024-05-02Declare as NORETURNNobuyoshi Nakada
2024-05-01Skip Warning.[] spec if mspec is passing warning optionsKevin Newton
2024-04-18chore: remove repetitive words (#10573)careworry
Signed-off-by: careworry <[email protected]>
2024-04-18Add a hint of `ASCII-8BIT` being `BINARY`Jean Boussier
[Feature #18576] Since outright renaming `ASCII-8BIT` is deemed to backward incompatible, the next best thing would be to only change its `#inspect`, particularly in exception messages.
2024-04-17`Fiber#raise` recursively raises on nested resuming_fiber. (#10482)Samuel Williams
* Improve consistency of `Fiber.current.raise`.
2024-04-17Revert an accidentally merged change [ci skip]Nobuyoshi Nakada
2024-04-17[Feature #20335] `Thread.each_caller_location` argumentsNobuyoshi Nakada
Accecpt the same arguments as `caller` and `caller_locations`.
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-10[Misc #18984] Raise TypeError from Range#size if the range is not iterableKouhei Yanagita
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-28Suppress warning at literal stringNobuyoshi Nakada
2024-03-27[DOC] remove repetitive words in commentscrazeteam
Signed-off-by: crazeteam <[email protected]>
2024-03-22[Feature #20275] Remove extra backtrace entries for rescue and ensureBenoit Daloze
2024-03-20[PRISM] Enable specs in CIKevin Newton
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-18Update set_backtrace documentationJean Boussier
Followup: https://github.com/ruby/ruby/pull/10017 [Feature #13557]
2024-03-16Prefer the simple read/write `File` singleton methodsNobuyoshi Nakada
2024-03-14Update to ruby/spec@89175b2Benoit Daloze
2024-03-14[Feature #20265] Remove rb_newobj_of and RB_NEWOBJ_OFPeter Zhu
2024-03-14`Exception#set_backtrace` accept arrays of `Backtrace::Location`Jean Boussier
[Feature #13557] Setting the backtrace with an array of strings is lossy. The resulting exception will return nil on `#backtrace_locations`. By accepting an array of `Backtrace::Location` instance, we can rebuild a `Backtrace` instance and have a fully functioning Exception. Co-Authored-By: Étienne Barrié <[email protected]>
2024-03-13Make `const_source_location` return the real constant as soon as definedJean Boussier
[Bug #20188] Ref: https://github.com/fxn/zeitwerk/issues/281#issuecomment-1893228355 Previously, it would only return the real constant location once the autoload was fully completed.
2024-03-07Removed unused fixtures at time examplesHiroshi SHIBATA
2024-03-06Run `binding.irb` in cleaner environment and clean the history fileNobuyoshi Nakada
2024-03-06Use include instead of equal assertion.Hiroshi SHIBATA
irb will load multiple rc files now. If developer have their rcfile on home directory or etc, equal assertion will fail with custom prompt.
2024-03-05[DOC] fix some commentscui fliter
Signed-off-by: cui fliter <[email protected]>
2024-03-03[Bug #20322] Fix rb_enc_interned_str_cstr null encodingThomas Marshall
The documentation for `rb_enc_interned_str_cstr` notes that `enc` can be a null pointer, but this currently causes a segmentation fault when trying to autoload the encoding. This commit fixes the issue by checking for NULL before calling `rb_enc_autoload`.
2024-03-01Add an example for fallback to shNobuyoshi Nakada
2024-02-28[PRISM] Fix version spec to account for prismKevin Newton
2024-02-27Handle zero-like imaginary part as zero in to_r (#9581)Kenta Murata
Fixes [Bug #5179]