summaryrefslogtreecommitdiff
path: root/spec/ruby
AgeCommit message (Collapse)Author
2023-04-23Check the precision of `getrusage` at runtimeNobuyoshi Nakada
2023-04-22Fix a guard of `Process.times`Nobuyoshi Nakada
`GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID` clock uses `getrusage` always if available as the name states. That is if it is implemented `getrusage` is available, regardless microseconds in its results. Notes: Merged: https://github.com/ruby/ruby/pull/7739
2023-04-22Fix an example of `Process.times`Nobuyoshi Nakada
Prior to commit 5806c54447439f2ba22892e4045e78dd80f96f0c, it was "at least one result with precision beyond milliseconds (with none-zero microseconds) should exist"; after this commit, "at least one result should have zero microseconds". This chance is lower than the previous condition. Notes: Merged: https://github.com/ruby/ruby/pull/7739
2023-04-21Skip when unix socket path is too longNobuyoshi Nakada
Eventually the path directly under "/tmp" is complained by `rm_r` in spec/mspec/lib/mspec/helpers/fs.rb. Notes: Merged: https://github.com/ruby/ruby/pull/7749
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-04-19MatchData#named_captures: add optional symbolize_names keyword (#6952)Vladimir Dementyev
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-04-17Add spec for `Warning[:performance]`Jean Boussier
[Feature #19538] Notes: Merged: https://github.com/ruby/ruby/pull/7715
2023-04-15Implement ObjectSpace::WeakMap#delete and ObjectSpace::WeakKeyMap#deleteJean Boussier
[Feature #19561] It's useful to be able to remove references from weak maps. Notes: Merged: https://github.com/ruby/ruby/pull/7629
2023-04-15* append newline at EOF. [ci skip]git
2023-04-15Add specs for ObjectSpace::WeakKeyMapJean Boussier
[Feature #18498] Notes: Merged: https://github.com/ruby/ruby/pull/7716
2023-04-14Revert "Add specs for ObjectSpace::WeakKeyMap"Jean Boussier
This reverts commit fce8f9f24e4903784266fc9694f86ddd930d6141.
2023-04-14Add specs for ObjectSpace::WeakKeyMapJean Boussier
[Feature #18498] Notes: Merged: https://github.com/ruby/ruby/pull/7640
2023-04-14[Bug #19533] Add spec of infinite range inclusionNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7574
2023-04-07[Bug #19584] Register global variables before assignmentNobuyoshi Nakada
2023-04-04Revert "Fix transient heap mode"Aaron Patterson
This reverts commit 87253d047ce35e7836b6f97edbb4f819879a3b25. Revert "Implement `Process.warmup`" This reverts commit ba6ccd871442f55080bffd53e33678c0726787d2.
2023-04-04Implement `Process.warmup`Jean Boussier
[Feature #18885] For now, the optimizations performed are: - Run a major GC - Compact the heap - Promote all surviving objects to oldgen Other optimizations may follow. Notes: Merged: https://github.com/ruby/ruby/pull/7346
2023-03-24Raise ArgumentError if IO.read is provided negative offsetJeremy Evans
Fixes [Bug #19380] Notes: Merged: https://github.com/ruby/ruby/pull/7289
2023-03-24Add Dir.fchdirJeremy Evans
This is useful for passing directory file descriptors over UNIX sockets or to child processes to avoid TOCTOU vulnerabilities. The implementation follows the Dir.chdir code. This will raise NotImplementedError on platforms not supporting both fchdir and dirfd. Implements [Feature #19347] Notes: Merged: https://github.com/ruby/ruby/pull/7135
2023-03-24Change Hash#compact to keep default values and compare_by_identity flagJeremy Evans
The documentation states it returns a copy of self with nil value entries removed. However, the previous behavior was creating a plain new hash with non-nil values copied into it. This change aligns the behavior with the documentation. Fixes [Bug #19113] Notes: Merged: https://github.com/ruby/ruby/pull/6702
2023-03-24Copy compare_by_identity flag for empty hashes in Hash.ruby2_keywords_hashJeremy Evans
This was already copied for non-empty hashes. As Hash.ruby2_keywords_hash copies default values, it should also copy the compare_by_identity flag. Partially Fixes [Bug #19113] Notes: Merged: https://github.com/ruby/ruby/pull/6702
2023-03-24Do not copy compare_by_identity flag for non-empty hashes in Hash.[]Jeremy Evans
It wasn't copied for empty hashes, and Hash.[] doesn't copy the default value, so copying the compare_by_identity flag does not make sense. Partially Fixes [Bug #19113] Notes: Merged: https://github.com/ruby/ruby/pull/6702
2023-03-22Added assertion values for Amazon Linux 2023Hiroshi SHIBATA
2023-03-15rb_ary_sum: don't enter fast path if initial isn't a native numeric type.Jean Boussier
[Bug #19530] If the initial value isn't one of the special cased types, we directly jump to the slow path. Notes: Merged: https://github.com/ruby/ruby/pull/7519
2023-03-10Accept `sleep(nil)` as sleep forever. (#7484)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-03-06s/mjit/rjit/Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/7462
2023-03-06s/MJIT/RJIT/Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/7462
2023-02-27Skip a spec failing on masterTakashi Kokubun
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
2023-02-27Update to ruby/spec@e7dc804Benoit Daloze
2023-02-25Assigning `nil` to fiber storage deletes the association. (#7378)Samuel Williams
Also avoid allocations when looking up `Fiber#storage` if not needed. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-02-22Use `BigDecimal::VERSION` instead of `RUBY_VERSION`Nobuyoshi Nakada
2023-02-21Marshal.load: restore instance variables on RegexpJean Boussier
[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. Notes: Merged: https://github.com/ruby/ruby/pull/7323
2023-02-20Update some ruby specs for the new message format of NoMethodErrorYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/6950
2023-02-17BigDecimal changed #remainder's specTakashi Kokubun
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
2023-02-13Marshal.load: also freeze extended objectsJean Boussier
[Bug #19427] The `proc` wouldn't be called either, that fixes both. Notes: Merged: https://github.com/ruby/ruby/pull/7284
2023-02-10[DOC] Move old ChangeLog files to doc/ChangeLog (#7293)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-02-08Use Thread.pass until thread.stop? to wait for thread to blockJean Boussier
[Bug #19415] It should be more reliable Notes: Merged: https://github.com/ruby/ruby/pull/7270
2023-02-08Only emit circular dependency warning for owned thread shieldsJean byroot Boussier
[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. Notes: Merged: https://github.com/ruby/ruby/pull/7257
2023-02-06Revert "Only emit circular dependency warning for owned thread shields"Jean byroot Boussier
This reverts commit fa49651e05a06512e18ccb2f54a7198c9ff579de. Notes: Merged: https://github.com/ruby/ruby/pull/7256
2023-02-06Only emit circular dependency warning for owned thread shieldsJean Boussier
[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. Notes: Merged: https://github.com/ruby/ruby/pull/7252
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-23blade is hosted under ruby-lang.org nowHiroshi SHIBATA
2023-01-22More coverage tests & specs. (#7171)Samuel Williams
* Add spec for eval and line coverage. * Add test for main file coverage. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-01-18Define RUBY_VERSION_IS_3_3 macro in rubyspec.hNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7145
2023-01-15[Bug #19335] `Integer#remainder` should respect `#coerce` (#7120)Nobuyoshi Nakada
Also `Numeric#remainder` should. Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2023-01-11Move classpath to rb_classext_tPeter Zhu
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) ``` Notes: Merged: https://github.com/ruby/ruby/pull/7096
2023-01-11Remove Encoding#replicateBenoit Daloze
Notes: Merged: https://github.com/ruby/ruby/pull/7079
2023-01-07Only RangeError on CRuby for shift width >= 2**67Benoit Daloze
* It seems a better exception class too than NoMemoryError.
2023-01-07Fix Integer#{<<,>>} specs with large shift widthBenoit Daloze
* The limit depends on the implementation and platform, it seems unavoidable. * See https://bugs.ruby-lang.org/issues/18518#note-9
2023-01-06Add bug numberBenoit Daloze
2023-01-05Update to ruby/spec@5e48206Benoit Daloze