summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-11-30[ruby/prism] Add other UTF8 encodingsKevin Newton
https://github.com/ruby/prism/commit/709fb6e09f
2023-11-30YJIT: Cancel on-stack jit_return on invalidation (#9086)Takashi Kokubun
* YJIT: Cancel on-stack jit_return on invalidation Co-authored-by: Alan Wu <alansi.xingwu@shopify.com> * Use RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P --------- Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
2023-11-30YJIT: Use `stats[:live_page_count]`, renamed from :compiled_page_countAlan Wu
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-11-30[Prism] Fix local variable access for POST_EXECUTION_NODEMatt Valentine-House
2023-11-30Store depth offset inside the scope node.Matt Valentine-House
Instead of incrementing the depth using call by reference as we're recursing up the stack we could instead store an offset for each known scope where we know the depth is going to represented differently in the Prism ast.
2023-11-30[rubygems/rubygems] Only show "Defaulting to user installation" message when ↵Ellen Marie Dash
it matters. https://github.com/rubygems/rubygems/commit/61b0947225
2023-11-30[ruby/irb] Page evaluation result's outputStan Lo
(https://github.com/ruby/irb/pull/784) * Page evaluation result's output This will make it easier to work with long output that exceeds the terminal's height. * Use consistent TERM in rendering tests This makes sure we get consistent result on all platforms. https://github.com/ruby/irb/commit/4fedce93d3
2023-11-30[ruby/rdoc] Get rid of `Kernel#open`Nobuyoshi Nakada
https://github.com/ruby/rdoc/commit/dc56f6d0bd
2023-11-30Add a rescue for `defined?(A::B::C)`Aaron Patterson
It's possible for `defined?(A::B::C)` to raise an exception. `defined?` must swallow the exception and return nil, so this commit adds a rescue entry for `defined?` expressions on constant paths
2023-11-30[ruby/prism] Fix lex_compat for `<<HEREDOC # comment` at EOFMartin Emde
Fixes https://github.com/ruby/prism/pull/1874 https://github.com/ruby/prism/commit/304dd78dd2
2023-11-30[Bug #19877] Assign captures for direct regexp literal onlyNobuyoshi Nakada
2023-11-30Add some test cases to Data testOKURA Masafumi
I noticed that `deconstruct` and `hash` don't have enough coverage. The behavior of `hash` is documented so I copied it.
2023-11-30Skip test_resolurion_error_error_code with FreeBSD environmentHiroshi SHIBATA
https://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20231130T103002Z.fail.html.gz
2023-11-30[ruby/cgi] Add failing test cases for CGI::Escape.unescapeHTMLflosacca
https://github.com/ruby/cgi/commit/92fdb3316b
2023-11-30Fix the argument orderNobuyoshi Nakada
2023-11-30Replace SocketError with Socket::ResolutionError in rsock_raise_socket_errorMisaki Shioi
rsock_raise_socket_error is called only when getaddrinfo and getaddrname fail
2023-11-29Guard match from GC in String#gsubPeter Zhu
We need to guard match from GC because otherwise it could end up being reclaimed or moved in compaction.
2023-11-29[PRISM] Implement CallNodes with splat followed by argsJemma Issroff
2023-11-29[PRISM] Account for ImplicitRestNodeJemma Issroff
Prism introduced a new ImplicitRestNode. This adds tests for the ImplicitRestNode cases, and changes one assert which is no longer accurate.
2023-11-29[PRISM] Fix EnsureNode, pass depth to get localsJemma Issroff
This commit fixes a bug with locals in ensure nodes by setting the local tables correctly. It also changes accessing locals to look at local tables in parent scopes, and account for this correctly on depths of get or setlocals.
2023-11-29[ruby/prism] Add MacJapanese encodingMatt Boldt
MacJapanese (also aliased as MacJapan) is a modified Shift_JIS encoding, but is implemented identically in Ruby https://github.com/ruby/prism/commit/9e0a097699
2023-11-29[ruby/irb] Use gem repl_type_completor, remove type_completiontomoya ishida
implementation (https://github.com/ruby/irb/pull/772) https://github.com/ruby/irb/commit/a4868a5373
2023-11-29[ruby/prism] added CP950 encodingDhaval
https://github.com/ruby/prism/commit/9c2d1cf4ba
2023-11-29Add missing assertion in test_use_all_shapes_then_freezePeter Zhu
2023-11-29[ruby/prism] Convert start line to signed integersJean Boussier
Ruby allows for 0 or negative line start, this is often used with `eval` calls to get a correct offset when prefixing a snippet. e.g. ```ruby caller = caller_locations(1, 1).first class_eval <<~RUBY, caller.path, caller.line - 2 # frozen_string_literal: true def some_method #{caller_provided_code_snippet} end RUBY ``` https://github.com/ruby/prism/commit/0d14ed1452
2023-11-29[Bug #17037] Improve accuracy of division near precision limitsNobuyoshi Nakada
When dividing near the precision limit of `double`, use Bignum division to get rid of rounding errors.
2023-11-29[Bug #20025] Check if upper/lower before fallback to case-foldingNobuyoshi Nakada
2023-11-29[ruby/prism] Reject class/module defs in method params/rescue/ensure/elseTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1936 https://github.com/ruby/prism/commit/232e77a003
2023-11-29Array#rassoc should try to convert to array implicitly. Fixes #20003Tema Bolshakov
2023-11-28Fix Ractor sharing for too complex ObjectsPeter Zhu
2023-11-28Fix Ractor sharing for too complex generic ivarsPeter Zhu
2023-11-28[ruby/prism] Implicit rest nodesKevin Newton
Fundamentally, `foo { |bar,| }` is different from `foo { |bar, *| }` because of arity checks. This PR introduces a new node to handle that, `ImplicitRestNode`, which goes in the `rest` slot of parameter nodes instead of `RestParameterNode` instances. This is also used in a couple of other places, namely: * pattern matching: `foo in [bar,]` * multi target: `for foo, in bar do end` * multi write: `foo, = bar` Now the only splat nodes with a `NULL` value are when you're forwarding, as in: `def foo(*) = bar(*)`. https://github.com/ruby/prism/commit/dba2a3b652
2023-11-28[PRISM] Don't calculate params size based on localsJemma Issroff
Prior to this commit, we were conflating the size of the locals list with the number of parameters. This commit distinguishes the two, and fixes a related bug which would occur if we set a local that was not a parameter
2023-11-28[ruby/prism] Add numbered_parameters field to BlockNode and LambdaNodeJemma Issroff
We are aware at parse time how many numbered parameters we have on a BlockNode or LambdaNode, but prior to this commit, did not store that information anywhere in its own right. The numbered parameters were stored as locals, but this does not distinguish them from other locals that have been set, for example in `a { b = 1; _1 }` there is nothing on the AST that distinguishes b from _1. Consumers such as the compiler need to know information about how many numbered parameters exist to set up their own tables around parameters. Since we have this information at parse time, we should compute it here, instead of deferring the work later on. https://github.com/ruby/prism/commit/bf4a1e124d
2023-11-28Further fix the GVL instrumentation APIJean Boussier
Followup: https://github.com/ruby/ruby/pull/9029 [Bug #20019] Some events still weren't triggered from the right place. The test suite was also improved a bit more.
2023-11-28[PRISM] Implement more compilation of SplatNodesJemma Issroff
There was a bug with the rest argument in SplatNodes, this commit fixes it, and adds more tests illustrating the behavior of SplatNodes
2023-11-28[PRISM] Compile YieldNode with different argumentsJemma Issroff
2023-11-28Fix cache incoherency for ME resolved through VM_METHOD_TYPE_REFINEDAlan Wu
Previously, we didn't invalidate the method entry wrapped by VM_METHOD_TYPE_REFINED method entries which could cause calls to land in the wrong method like it did in the included test. Do the invalidation, and adjust rb_method_entry_clone() to accommodate this new invalidation vector. Fix: cfd7729ce7a31c8b6ec5dd0e99c67b2932de4732 See-also: e201b81f79828c30500947fe8c8ea3c515e3d112
2023-11-28[PRISM] Run test setting global constant separatelyAlan Wu
This impacted other tests. Please mind the commons. /home/runner/work/ruby/ruby/src/test/ruby/test_compile_prism.rb:394: warning: already initialized constant Bar /tmp/test_reline_config_60145/bazbarbob.rb:6: warning: previous definition of Bar was here 1) Failure: TestModule#test_const_get_evaled [/home/runner/work/ruby/ruby/src/test/ruby/test_module.rb:1239]: NameError expected but nothing was raised.
2023-11-28[ruby/prism] Fix testsTSUYUSATO Kitsune
https://github.com/ruby/prism/commit/1e6ecbaf04
2023-11-28[ruby/prism] Reset `current_param_name` around closed scopesTSUYUSATO Kitsune
It is for supporting `def foo(bar = (def baz(bar) = bar; 1)) = 2` case. https://github.com/ruby/prism/commit/c789a833c5
2023-11-28[ruby/prism] Use `0` for the default valie of `current_param_name`TSUYUSATO Kitsune
https://github.com/ruby/prism/commit/896915de24
2023-11-28[ruby/prism] Check circular references in default values of paramsTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1637 https://github.com/ruby/prism/commit/0172d69cba
2023-11-28[ruby/irb] Change show_source tests into integration testsPeter Zhu
* Remove trailing spaces * Migrate show_source tests to integration tests Because show_source tests often need to define class and/or methods, they can easily leak state to other tests. Changing them to integration tests will ensure that they are run in a clean environment. * Fix NoMethodError caused by SourceFinder#method_target https://github.com/ruby/irb/commit/3c39f13397c72a8db24e50afdcb8942e6c4ea12f
2023-11-28[ruby/irb] This enhancement allows a user to add the -s flag if theypaulreece
want to access a methods origin definition. It allows for chaining of multiple esses to further go up the classes as needed. (https://github.com/ruby/irb/pull/770) https://github.com/ruby/irb/commit/eec1329d5a
2023-11-28[ruby/irb] Rescue errors from main.to_s/inspect when formattingKasumi Hanazuki
prompt (https://github.com/ruby/irb/pull/791) Currently, IRB just terminates if `main.to_s` raises while IRB constructs the prompt string. This can easily happen if the user wants to start an IRB session in the instance scope of an uninitialized object, for example: ``` class C def initialize binding.irb @values = [] end def to_s = @values.join(',') # raises if uninitialized end C.new ``` This patch makes IRB rescue from such an exception and displays the class name of the exception instead of `main.to_s` to indicate some error has occurred. We may display more detailed information about the exception, but this patch chooses not to do so because 1) the prompt has limited space, 2) users can evaluate `to_s` in IRB to examine the error if they want, and 3) obtaining the details can also raise, which requires nested exception handling and can be complicated. https://github.com/ruby/irb/commit/412ab26067
2023-11-28[ruby/prism] Fix to parse `*` as forwarding in `foo[*]` caseTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1924 https://github.com/ruby/prism/commit/7cde900065
2023-11-28[ruby/prism] Move DATA parsing into its own parse result fieldKevin Newton
https://github.com/ruby/prism/commit/42b60b6e95
2023-11-28Make Range#reverse_each raise TypeError if endlessKouhei Yanagita
2023-11-28[ruby/prism] Use un-capitalized error messagesKevin Newton
I don't prefer this style, but it appears that a plurality of syntax error messages between with un-capitalized messages in CRuby, so we'll go with that for consistency, for now. https://github.com/ruby/prism/commit/b02df68954