summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
2023-10-05Optimize `Range#count` by using `range_size` if possibleKouhei Yanagita
2023-10-02YJIT: Fix assert_no_exits (#8579)Takashi Kokubun
2023-10-02`yield` cannot be placed outside methods even in blocksNobuyoshi Nakada
2023-10-01[Bug #19906] Add the testNobuyoshi Nakada
2023-10-01Move repeating `matches` and `unmatches` to keyword argumentsNobuyoshi Nakada
And default to the corresponding instance variables.
2023-10-01Add tests for Unicode age property 15.0Nobuyoshi Nakada
2023-09-29YJIT: Chain-guard opt_mult overflow (#8554)Takashi Kokubun
* YJIT: Chain-guard opt_mult overflow * YJIT: Support regenerating Jo after Mul
2023-09-29Handle static array nodesKevin Newton
2023-09-29Compile implicit nodesKevin Newton
2023-09-29Fix up static hash compilationKevin Newton
2023-09-29Fix to replace only `-e` that is a path name in `assert_crash_report`Nobuyoshi Nakada
2023-09-28Support local variable targeting in pattern matchingKevin Newton
2023-09-28Support the AlternationPatternNodeKevin Newton
2023-09-28Compile basic pattern matching expressionsKevin Newton
2023-09-29Fix `retry` in nested `rescue` blocksNobuyoshi Nakada
Restore `rescue`-context from the outer context. `retry` targets the next outer block except for between `rescue` and `else` or `ensure`, otherwise, if there is no enclosing block, it should be syntax error.
2023-09-28Consolidate regexp options, interpolated match last lineKevin Newton
2023-09-28Move IO#readline to RubyAaron Patterson
This commit moves IO#readline to Ruby. In order to call C functions, keyword arguments must be converted to hashes. Prior to this commit, code like `io.readline(chomp: true)` would allocate a hash. This commits moves the keyword "denaturing" to Ruby, allowing us to send positional arguments to the C API and avoiding the hash allocation. Here is an allocation benchmark for the method: ``` x = GC.stat(:total_allocated_objects) File.open("/usr/share/dict/words") do |f| f.readline(chomp: true) until f.eof? end p ALLOCATIONS: GC.stat(:total_allocated_objects) - x ``` Before this commit, the output was this: ``` $ make run ./miniruby -I./lib -I. -I.ext/common -r./arm64-darwin22-fake ./test.rb {:ALLOCATIONS=>707939} ``` Now it is this: ``` $ make run ./miniruby -I./lib -I. -I.ext/common -r./arm64-darwin22-fake ./test.rb {:ALLOCATIONS=>471962} ``` [Bug #19890] [ruby-core:114803]
2023-09-28[YARP] Implement MatchWriteNodeMatt Valentine-House
2023-09-28Fix order-dependent tests in test_compile_prismKevin Newton
2023-09-28Move CRuby-specific prism files to top levelKevin Newton
2023-09-28Syntax check of `yield` in the parserNobuyoshi Nakada
2023-09-28Jumps are possible in the top-level loopNobuyoshi Nakada
2023-09-28Suppress void context warnings in verbose modeNobuyoshi Nakada
2023-09-28Suppress void context warningsNobuyoshi Nakada
2023-09-27Make {Queue,SizedQueue}#freeze raise TypeErrorJeremy Evans
Fixes [Bug #17146]
2023-09-27Out of place jumps are valid in `defined?`Nobuyoshi Nakada
2023-09-27Syntax check of `retry` in the parserNobuyoshi Nakada
2023-09-27Fix error token locationNobuyoshi Nakada
2023-09-27Syntax check of block exits in the parserNobuyoshi Nakada
2023-09-26Run crash report test processes without `RUBY_ON_BUG`Nobuyoshi Nakada
These processes are to be crashed, avoid running debugger.
2023-09-26Prevent warnings: "unused literal ignored"Yusuke Endoh
``` [24688/26146] TestParse#test_named_capture_in_block(eval at /home/chkbuild/chkbuild/tmp/build/20230926T063004Z/ruby/test/ruby/test_parse.rb:999):1: warning: unused literal ignored (eval at /home/chkbuild/chkbuild/tmp/build/20230926T063004Z/ruby/test/ruby/test_parse.rb:999):1: warning: unused literal ignored (eval at /home/chkbuild/chkbuild/tmp/build/20230926T063004Z/ruby/test/ruby/test_parse.rb:999):1: warning: unused literal ignored (eval at /home/chkbuild/chkbuild/tmp/build/20230926T063004Z/ruby/test/ruby/test_parse.rb:999):1: warning: unused literal ignored (eval at /home/chkbuild/chkbuild/tmp/build/20230926T063004Z/ruby/test/ruby/test_parse.rb:999):1: warning: unused literal ignored (eval at /home/chkbuild/chkbuild/tmp/build/20230926T063004Z/ruby/test/ruby/test_parse.rb:999):1: warning: possibly useless use of + in void context = 0.00 s ```
2023-09-26Run crash report test processes without `RUBY_ON_BUG`Nobuyoshi Nakada
These processes are to be crashed, avoid running debugger.
2023-09-25[Feature #19790] Rename BUGREPORT_PATH as CRASH_REPORTNobuyoshi Nakada
2023-09-25Invoke the command when RUBY_BUGREPORT_PATH starts with `|`Nobuyoshi Nakada
2023-09-25Redirect to RUBY_BUGREPORT_PATH fileNobuyoshi Nakada
2023-09-23[Bug #19901]Adam Hess
fix leak in module clone Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2023-09-23Fix memory leak in Hash#rehash for ST hashesPeter Zhu
We need to free the old ST table in Hash#rehash. Co-authored-by: Adam Hess <adamhess1991@gmail.com>
2023-09-22Magical wait to get rid of deadlock on macOSNobuyoshi Nakada
2023-09-22[Bug #19896]Adam Hess
fix memory leak in vm_method This introduces a unified reference_count to clarify who is referencing a method. This also allows us to treat the refinement method as the def owner since it counts itself as a reference Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2023-09-21Optimize Range#bsearch for beginless/endless ranges within FixnumKouhei Yanagita
2023-09-20Fix memory leak in complemented method entriesPeter Zhu
[Bug #19894] When a copy of a complemented method entry is created, there are two issues: 1. IMEMO_FL_USER3 is not copied, so the complemented status is not copied over. 2. In rb_method_entry_clone we increment both alias_count and complemented_count. However, when we free the method entry in rb_method_definition_release, we only decrement one of the two counters, resulting in the rb_method_definition_t being leaked. Co-authored-by: Adam Hess <adamhess1991@gmail.com>
2023-09-19[ruby/securerandom] Removed extra argument for build failure of ruby/rubyHiroshi SHIBATA
https://github.com/ruby/ruby/actions/runs/6230184763/job/16909829150 https://github.com/ruby/securerandom/commit/f60582432c
2023-09-19[ruby/securerandom] Add support for UUID version 7nick evans
Although the specification for UUIDv7 is still in draft, the UUIDv7 algorithm has been relatively stable as it progresses to completion. Version 7 UUIDs can be very useful, because they are lexographically sortable, which can improve e.g: database index locality. See section 6.10 of the draft specification for further explanation: https://datatracker.ietf.org/doc/draft-ietf-uuidrev-rfc4122bis/ The specification allows up to 12 bits of extra timestamp precision, to make UUID generation closer to monotonically increasing. This provides between 1ms and ~240ns of timestamp precision. At the cost of some code complexity and a small performance penalty, a kwarg may specify any arbitrary precision between 0 and 12 extra bits. Any stronger guarantees of monotonicity have considerably larger tradeoffs, so nothing more is implemented. This limitation is documented. Ruby issue: https://bugs.ruby-lang.org/issues/19735 https://github.com/ruby/securerandom/commit/34ed1a2ec3
2023-09-18[Bug #19887] RUBYOPT should work without leading `-`Nobuyoshi Nakada
2023-09-18Simplify restoring ENVNobuyoshi Nakada
2023-09-16Fix regression when testing inclusion in unbounded rangesJeremy Evans
Caused by 04a92a6764bf678919cf4b68a27496a39d6b886a. This treats unbounded ranges of arbitrary objects the same as how unbounded string ranges are treated: (..x) === y # (y <=> x) <= 0 (...x) === y # (y <=> x) < 0 (x..) === y # (x <=> y) <= 0 Fixes [Bug #19864]
2023-09-16[Feature #19839] Fix `Range#overlap?` for empty rangesNobuyoshi Nakada
Empty ranges do not overlap with any range. Regarding benchmarks, PR#8242 is significantly faster in some cases, but one of these two cases is a wrong result. | |ActiveSupport| PR#8242|built-ruby| |:--------------------------|------------:|-------:|---------:| |(2..3).overlap?(1..1) | 7.761M| 15.053M| 32.368M| | | -| 1.94x| 4.17x| |(2..3).overlap?(2..4) | 25.720M| 55.070M| 21.981M| | | 1.17x| 2.51x| -| |(2..3).overlap?(4..5) | 7.616M| 15.048M| 21.730M| | | -| 1.98x| 2.85x| |(2..3).overlap?(2..1) | 25.585M| 56.545M| 32.786M| | | -| 2.21x| 1.28x| |(2..3).overlap?(0..1) | 7.554M| 14.755M| 32.545M| | | -| 1.95x| 4.31x| |(2..3).overlap?(...1) | 6.681M| 5.843M| 32.255M| | | 1.14x| -| 5.52x| |(2...3).overlap?(..2) | 6.676M| 5.817M| 21.572M| | | 1.15x| -| 3.71x| |(2...3).overlap?(3...) | 7.392M| 14.755M| 31.805M| | | -| 2.00x| 4.30x| |(2..3).overlap?('a'..'d') | 3.675M| 3.482M| 17.009M| | | 1.06x| -| 4.89x|
2023-09-16[Feature #19839] Add Range#overlap?Shouichi Kamiya
Add a method that returns true if two range overlap, otherwise false. ``` (0..10).overlap?(5..15) #=> true (0..10).overlap?(20..30) #=> false ```
2023-09-15[Bug #19882] Reject tokens invalid as symbolsNobuyoshi Nakada
2023-09-15Fix Thread#native_thread_id being cached across fork (#8418)KJ Tsanaktsidis
The native thread ID can and does change on some operating systems (e.g. Linux) after forking, so it needs to be re-queried. [Bug #19873] Notes: Merged-By: nurse <naruse@airemix.jp>