aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby
Commit message (Collapse)AuthorAgeFilesLines
* Skip a spec failing on masterTakashi Kokubun2023-02-271-5/+7
| | | | | | https://github.com/ruby/ruby/actions/runs/4286361460/jobs/7466545010 http://ci.rvm.jp/results/trunk_gcc9@ruby-sp2-docker/4462424 http://ci.rvm.jp/results/trunk_clang_13@ruby-sp2-docker/4462422
* Update to ruby/spec@e7dc804Benoit Daloze2023-02-27230-187/+1887
|
* Assigning `nil` to fiber storage deletes the association. (#7378)Samuel Williams2023-02-251-6/+13
| | | Also avoid allocations when looking up `Fiber#storage` if not needed.
* Use `BigDecimal::VERSION` instead of `RUBY_VERSION`Nobuyoshi Nakada2023-02-221-1/+1
|
* Marshal.load: restore instance variables on RegexpJean Boussier2023-02-211-0/+11
| | | | | | | | | | | | | | | | | | | [Bug #19439] The instance variables were restore on the Regexp source, not the regexp itself. Unfortunately we have a bit of a chicken and egg problem. The source holds the encoding, and the encoding need to be set on the source to be able to instantiate the Regexp. So the instance variables have to be read on the `source`. To correct this we transfert the instance variables after instantiating the Regexp. The only way to avoid this would be to read the instance variable twice and rewind.
* Update some ruby specs for the new message format of NoMethodErrorYusuke Endoh2023-02-201-17/+40
|
* BigDecimal changed #remainder's specTakashi Kokubun2023-02-171-13/+15
| | | | | | | | | | | | | | This test is no longer passing: ``` 1) BigDecimal#remainder returns NaN if Infinity is involved FAILED Expected Infinity.nan? to be truthy but was false /home/runner/work/ruby/ruby/src/spec/ruby/library/bigdecimal/remainder_spec.rb:58:in `block (2 levels) in <top (required)>' /home/runner/work/ruby/ruby/src/spec/ruby/library/bigdecimal/remainder_spec.rb:4:in `<top (required)>' ``` https://github.com/ruby/bigdecimal/pull/243
* Marshal.load: also freeze extended objectsJean Boussier2023-02-131-0/+20
| | | | | | [Bug #19427] The `proc` wouldn't be called either, that fixes both.
* [DOC] Move old ChangeLog files to doc/ChangeLog (#7293)Takashi Kokubun2023-02-102-2/+2
|
* Use Thread.pass until thread.stop? to wait for thread to blockJean Boussier2023-02-081-1/+1
| | | | | | [Bug #19415] It should be more reliable
* Only emit circular dependency warning for owned thread shieldsJean byroot Boussier2023-02-082-0/+15
| | | | | | | | | | [Bug #19415] If multiple threads attemps to load the same file concurrently it's not a circular dependency issue. So we check that the existing ThreadShield is owner by the current fiber before warning about circular dependencies.
* Revert "Only emit circular dependency warning for owned thread shields"Jean byroot Boussier2023-02-062-11/+0
| | | | This reverts commit fa49651e05a06512e18ccb2f54a7198c9ff579de.
* Only emit circular dependency warning for owned thread shieldsJean Boussier2023-02-062-0/+11
| | | | | | | | | | [Bug #19415] If multiple threads attemps to load the same file concurrently it's not a circular dependency issue. So we check that the existing ThreadShield is owner by the current fiber before warning about circular dependencies.
* Add tests for variables in `END` block shared with the toplevelNobuyoshi Nakada2023-01-241-0/+4
|
* blade is hosted under ruby-lang.org nowHiroshi SHIBATA2023-01-235-5/+5
|
* More coverage tests & specs. (#7171)Samuel Williams2023-01-221-1/+7
| | | | | * Add spec for eval and line coverage. * Add test for main file coverage.
* Define RUBY_VERSION_IS_3_3 macro in rubyspec.hNobuyoshi Nakada2023-01-181-3/+8
|
* [Bug #19335] `Integer#remainder` should respect `#coerce` (#7120)Nobuyoshi Nakada2023-01-151-0/+3
| | | Also `Numeric#remainder` should.
* Move classpath to rb_classext_tPeter Zhu2023-01-111-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit moves the classpath (and tmp_classpath) from instance variables to the rb_classext_t. This improves performance as we no longer need to set an instance variable when assigning a classpath to a class. I benchmarked with the following script: ```ruby name = :MyClass puts(Benchmark.measure do 10_000_000.times do |i| Object.const_set(name, Class.new) Object.send(:remove_const, name) end end) ``` Before this patch: ``` 5.440119 0.025264 5.465383 ( 5.467105) ``` After this patch: ``` 4.889646 0.028325 4.917971 ( 4.942678) ```
* Remove Encoding#replicateBenoit Daloze2023-01-111-1/+1
|
* Only RangeError on CRuby for shift width >= 2**67Benoit Daloze2023-01-072-28/+14
| | | | * It seems a better exception class too than NoMemoryError.
* Fix Integer#{<<,>>} specs with large shift widthBenoit Daloze2023-01-072-28/+46
| | | | | * The limit depends on the implementation and platform, it seems unavoidable. * See https://bugs.ruby-lang.org/issues/18518#note-9
* Add bug numberBenoit Daloze2023-01-061-1/+1
|
* Update to ruby/spec@5e48206Benoit Daloze2023-01-053-6/+2
|
* Update to ruby/spec@7e680faBenoit Daloze2023-01-052-3/+4
|
* * remove trailing spaces, append newline at EOF. [ci skip]git2023-01-054-4/+4
|
* Update to ruby/spec@9d69b95Benoit Daloze2023-01-05113-236/+1954
|
* Make IO#set_encoding with binary external encoding use nil internal encodingJeremy Evans2023-01-011-6/+18
| | | | | | | | | | | | | | This was already the behavior when a single `'external:internal'` encoding specifier string was passed. This makes the behavior consistent for the case where separate external and internal encoding specifiers are provided. While here, fix the IO#set_encoding method documentation to state that either the first or second argument can be a string with an encoding name, and describe the behavior when the external encoding is binary. Fixes [Bug #18899]
* numeric.c: Fix round_half_even for specific values (#7023)Kenta Murata2022-12-261-1/+1
| | | | Handle the integert and the float parts separately in round_half_even to prevent error occursions in floating point calculation.
* Skip insanely memory consuming testsNobuyoshi Nakada2022-12-263-2/+6
| | | | | These tests do not only consume hundreds GiB bytes memory, result in `rb_bug` when `RUBY_DEBUG` is enabled.
* Skip some examples for Ruby 3.3Hiroshi SHIBATA2022-12-265-5/+5
|
* Windows: Prefer USERPROFILE over HOMEPATHLars Kanis2022-12-241-0/+17
| | | | | | | | | HOMEPATH is set to "\WINDOWS\system32" when running per "runas" session. This directory is not writable by ordinary users, leading to errors with many ruby tools. Also config files in the home directory are not recognized. Still keeping HOME at first which is not used by native Windows, but by ruby specs and by MSYS2 environment.
* Windows: Fix encoding of Dir.homeLars Kanis2022-12-241-0/+11
| | | | | | | Dir.home returns an UTF-8 string since ruby-3.0, but the actual encoding of the bytes was CP_ACP or CP_OEMCP. That led to invalid bytes when calling Dir.home with an unicode username.
* Always issue deprecation warning when calling Regexp.new with 3rd positional ↵Jeremy Evans2022-12-221-39/+43
| | | | | | | | | | | | | | argument Previously, only certain values of the 3rd argument triggered a deprecation warning. First step for fix for bug #18797. Support for the 3rd argument will be removed after the release of Ruby 3.2. Fix minor fallout discovered by the tests. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
* Ensure Fiber storage is only accessed from the Fiber it belongs toBenoit Daloze2022-12-201-13/+13
|
* Never use the storage of another Fiber, that violates the whole designBenoit Daloze2022-12-201-8/+0
| | | | * See https://bugs.ruby-lang.org/issues/19078#note-30
* Remove `require 'io/wait'` where it's no longer necessary. (#6932)Samuel Williams2022-12-152-2/+6
| | | | | | | * Remove `require 'io/wait'` as it's part of core now. * Update ruby specs using version gates. * Add note about why it's conditional.
* Add spec for fiber storage. (#6896)Samuel Williams2022-12-101-0/+111
|
* Clean up a temporary fileNobuyoshi Nakada2022-12-091-1/+4
|
* [Bug #19167] Remove useless conversion of classes for special constNobuyoshi Nakada2022-12-091-3/+5
|
* Introduce `IO.new(..., path:)` and promote `File#path` to `IO#path`. (#6867)Samuel Williams2022-12-082-6/+19
|
* update rbconfig spec to Unicode version 15.0.0Martin Dürst2022-12-062-4/+4
| | | | (this includes emoji version 15.0)
* Remove unguaranteed assertion [ci skip]Nobuyoshi Nakada2022-12-031-6/+0
| | | | | | It can be configured by `--with-os-version-style=TYPE` option, and just copies from theApple's installation as the default. We don't know why it is major only.
* UnboundMethod only refer defined_classKoichi Sasada2022-12-034-17/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | UnboundMethod records caller's class, like `D` or `E` on the following case: ```ruby class C def foo = :foo end class D < C end class E < C end d = D.instance_method(:foo) e = E.instance_method(:foo) ``` But `d` and `e` only refers `C#foo` so that UnboundMethod doesn't record `D` or `E`. This behavior changes the following methods: * `UnboundMethod#inspect` (doesn't show caller's class) * `UnboundMethod#==` (`d == e` for example) fix https://bugs.ruby-lang.org/issues/18798
* [Bug #19087] Merge to "trailing garbage" caseNobuyoshi Nakada2022-12-021-6/+3
|
* [Bug #19087] Fix an assertion of `String#to_c`Nobuyoshi Nakada2022-12-021-2/+4
|
* Make String#rstrip{,!} raise Encoding::CompatibilityError for broken coderangeJeremy Evans2022-11-241-7/+21
| | | | | | | | | | | | | | | | 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]
* Use valid tokens as cookie namesNobuyoshi Nakada2022-11-222-11/+11
|
* Fixup spec/ruby/optional/capi/rbasic_spec.rb for mswinMSP-Greg2022-11-212-2/+2
|
* Deal with different Ruby versionsTakashi Kokubun2022-11-121-2/+10
|