summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-10-11[flori/json] define_method is also private at Ruby 2.3 and 2.4Hiroshi SHIBATA
https://github.com/flori/json/commit/3804f38bf4
2023-10-11[flori/json] remove_method of Module is private at Ruby 2.3 and 2.4Hiroshi SHIBATA
https://github.com/flori/json/commit/6cbadf6b6e
2023-10-11Skip test_bug_13526 with High SierraHiroshi SHIBATA
2023-10-06[ruby/prism] Emit error when assigning to a numbered parameterHaldun Bayhantopcu
https://github.com/ruby/prism/commit/66248ac2f6
2023-10-06[ruby/prism] Introduce transparent scopes.Matt Valentine-House
A transparent scope is a scope that cannot have local variables added to it's local table. When a local is added to it's table, it instead gets added to the first non-transparent parent scope. This is used in for loops to ensure the correct depth for local variables inside the body https://github.com/ruby/prism/commit/ddb8e82253 Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
2023-10-06[ruby/openssl] Exact checks with `assert_include`Nobuyoshi Nakada
Where `assert_match` converts string matcher argument to regexp first with escaping, `assert_include` does the same thing simpler. https://github.com/ruby/openssl/commit/81007e0a49
2023-10-06[ruby/openssl] Exact checks with `assert_include`Nobuyoshi Nakada
https://github.com/ruby/openssl/commit/9a6e24daaf
2023-10-06Use size of `uintptr_t` for `j` and `J` testsNobuyoshi Nakada
`RbConfig::SIZEOF` has been added later than the time this check was committed first.
2023-10-06Move rbconfig to the topNobuyoshi Nakada
It is required in the always defined class level.
2023-10-06[ruby/prism] Add full_name to ConstantPathNode and ConstantPathTargetNodeVinicius Stock
https://github.com/ruby/prism/commit/b390553028
2023-10-05[ruby/prism] Check for duplicate parameter names in destructured paramsHaldun Bayhantopcu
https://github.com/ruby/prism/commit/c3438aabea
2023-10-05[ruby/prism] Check for duplicate names in shadow argsHaldun Bayhantopcu
https://github.com/ruby/prism/commit/e100c6b8ae
2023-10-05[ruby/prism] Fix parsing shadow args in lambda blocksHaldun Bayhantopcu
https://github.com/ruby/prism/commit/53efaf252d
2023-10-05[ruby/stringio] StringIO#pread: handle 0 length like IO#preadJean byroot Boussier
(https://github.com/ruby/stringio/pull/67) Fix: https://github.com/ruby/stringio/issues/66 If length is 0, IO#pread don't even try to read the IO, it simply return the buffer untouched if there is one or a new empty buffer otherwise. It also doesn't validate the offset when length is 0. cc @jdelStrother @kou https://github.com/ruby/stringio/commit/37e9279337 Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2023-10-05[ruby/net-http] Net::HTTPResponse nil checkingBrian Hawley
Fix nil handling in read_body and stream_check. Fixes: #70 https://github.com/ruby/net-http/commit/36f916ac18
2023-10-04[Prism] Fix IfNode and ElseNodeMatt Valentine-House
ElseNode looks to have been implemented at the same time as IfNode, but was resulting in a stack underflow error. The following is from the test code ``` if foo bar end ``` ``` ❯ make run compiling compile.c linking miniruby ./miniruby -I./lib -I. -I.ext/common -r./arm64-darwin22-fake ./test.rb CRUBY: ************************************************** == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(2,19)> 0000 putself ( 2)[Li] 0001 opt_send_without_block <calldata!mid:foo, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0003 branchunless 9 0005 putself 0006 opt_send_without_block <calldata!mid:bar, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0008 pop 0009 putobject_INT2FIX_1_ 0010 leave PRISM: ************************************************** -- raw disasm-------- 0000 putself ( 2) 0001 send <calldata:foo, 0>, nil ( 2) 0004 branchunless <L001> ( 2) 0006 jump <L000> ( 2) <L000> [sp: 0] * 0008 pop ( 1) 0009 putself ( 2) 0010 send <calldata:bar, 0>, nil ( 2) 0013 pop ( 2) 0014 jump <L002> ( 1) <L001> [sp: 0] <L002> [sp: -1] 0016 putobject 1 ( 2) 0018 leave ( 1) --------------------- <compiled>: <compiled>:1: argument stack underflow (-1) (SyntaxError) make: *** [run] Error 1 ``` This commit fixes the stack underflow error for both IfNode and ElseNode and introduces tests for them.
2023-10-05Optimize `Range#count` by using `range_size` if possibleKouhei Yanagita
2023-10-04[ruby/irb] Clear all context usages in RubyLexStan Lo
(https://github.com/ruby/irb/pull/684) After this change, `RubyLex` will not interact with `Context` directly in any way. This decoupling has a few benefits: - It makes `RubyLex` easier to test as it no longer has a dependency on `Context`. We can see this from the removal of `build_context` from `test_ruby_lex.rb`. - It will make `RubyLex` easier to understand as it will not be affected by state changes in `Context` objects. - It allows `RubyLex` to be used in places where `Context` is not available. https://github.com/ruby/irb/commit/d5b262a076
2023-10-03[rubygems/rubygems] Fix typo: eglible -> eligible.Josef Šimánek
https://github.com/rubygems/rubygems/commit/1e487e1337
2023-10-03[ruby/csv] Add CSV::InvalidEncodingErrorKosuke Shibata
(https://github.com/ruby/csv/pull/287) To handle encoding errors in CSV parsing with the appropriate error class https://github.com/ruby/csv/commit/68b44887e5
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-02Sync with prism CallNode#name changesBenoit Daloze
* https://github.com/ruby/prism/pull/1533
2023-10-02[ruby/psych] Add test for code_point_limitCharles Oliver Nutter
Only supported on JRuby currently. https://github.com/ruby/psych/commit/0c1754eefe
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-30[ruby/irb] Fix Reline's test failure running with `make test-alltomoya ishida
TESTS='reline irb'` (https://github.com/ruby/irb/pull/722) * Specify TestInputMethod in test to avoid RelineInputMethod to be used * Reset Reline in teardown to avoid test failure of `make test-all TESTS="irb reline"` https://github.com/ruby/irb/commit/5d67967eb1
2023-09-30[rubygems/rubygems] Update SPDX list and warn on deprecated identifiers.Josef Šimánek
https://github.com/rubygems/rubygems/commit/61667028f5
2023-09-30Fix failures when all network interfaces are downNobuyoshi 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-29[ruby/zlib] Revert "Workaround: Fix test failures on Ubuntu jammy s390x."Jun Aruga
This reverts commit https://github.com/ruby/zlib/commit/9f3b9c470c05 because we will fix the issue on alternative way. https://github.com/ruby/zlib/commit/3dfe3f9110
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-29[ruby/ostruct] Emit a performance warning when OpenStruct is usedJean byroot Boussier
(https://github.com/ruby/ostruct/pull/56) The OpenStruct documentation clearly state that it shouldn't be used when performance is expected. Ruby 3.3 introduce a new category of warnings that is silenced by default: performance. The expected use case is to enable this warning when looking for potential performance issues within an application. As such I think it would make sense to emit a performance warning when OpenStruct is used, as it may help pinpoint that a dependency rely on it, etc. https://github.com/ruby/ostruct/commit/5826e12db8 Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
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-28[ruby/reline] Properly restore Reline::IOGate in test teardowntomoya ishida
(https://github.com/ruby/reline/pull/593) * Properly restore Reline::IOGate in test teardown * GeneralIO.reset should reset class variable existence https://github.com/ruby/reline/commit/c16d33dae5
2023-09-28Move CRuby-specific prism files to top levelKevin Newton
2023-09-28[ruby/prism] Check whether the predicate is closed for conditionalsHaldun Bayhantopcu
https://github.com/ruby/prism/commit/bf43006d0a
2023-09-28[ruby/prism] Check for a semicolon or a newline after the inheritance operatorHaldun Bayhantopcu
https://github.com/ruby/prism/commit/0326ba6775
2023-09-28[ruby/prism] Fix assertion failure for fwd params after restHaldun Bayhantopcu
https://github.com/ruby/prism/commit/f86bff6dd7