summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2024-01-20More testsBurdetteLamar
2024-01-19[ruby/prism] Handle stovetop start in constant path fullnameAdam Hess
https://github.com/ruby/prism/commit/3a216e63fe
2024-01-19[PRISM] Fix ensure code running twiceeileencodes
Fixes: ruby/prism#2212
2024-01-19Fix kwarg orderingAaron Patterson
Required keyword arguments need to come first. Fixes: https://github.com/ruby/prism/issues/2158 Co-authored-by: Kevin Newton <[email protected]>
2024-01-19Fix ensure code when running break in a while loopAaron Patterson
We need to run ensure code when breaking from a while loop Co-authored-by: John Hawthorn <[email protected]> Co-authored-by: Kevin Newton <[email protected]>
2024-01-19Extract rindaHiroshi SHIBATA
2024-01-19Extract abbrev as bundled gemsHiroshi SHIBATA
2024-01-19Extract observer as bundled gemsHiroshi SHIBATA
2024-01-19Revert "[rubygems/rubygems] Fix `require` of a default gem when unresolved ↵Hiroshi SHIBATA
gems depend on it" This reverts commit f1f5f22d22a149f20e019728b1ab35593d29d81a.
2024-01-19Revert "[rubygems/rubygems] Fix activation conflicts when circularly ↵Hiroshi SHIBATA
requiring a gem" This reverts commit db44088c2a92040879386aa5f268db4c858e4e5b. https://github.com/ruby/ruby/actions/runs/7578672002/job/20641640821 https://github.com/ruby/ruby/actions/runs/7578672002/job/20641641212 https://github.com/ruby/ruby/actions/runs/7578672002/job/20641642031
2024-01-19[rubygems/rubygems] Fix activation conflicts when circularly requiring a gemDavid Rodríguez
If a gem is required circular, and there are unresolved specs depending on it, we may end up in an activation conflict. The solution is to not try to activate unresolved gems when requiring a default gem, regardless of it having already been activated or not. https://github.com/rubygems/rubygems/commit/3b2b8f4e3e
2024-01-19[rubygems/rubygems] Fix `require` of a default gem when unresolved gems ↵David Rodríguez
depend on it The following conditions must be met: * A default gem is required. * A previous require left some gems unresolved, and those dependencies themselves depend on the default gem. In this case, rubygems require will first activate the default version of the gem, then try to activate another unresolved version of the default gem that conflicts with the first activation. The solution is, if we are in the middle of requiring a default gem, skip this step, because we have already activated it successfully. https://github.com/rubygems/rubygems/commit/8cd5608db5 Co-authored-by: Stan Hu <[email protected]>
2024-01-19[ruby/strscan] Add test to check encoding for empty stringNAITOH Jun
(https://github.com/ruby/strscan/pull/80) See: https://github.com/ruby/strscan/issues/78#issuecomment-1890849891 https://github.com/ruby/strscan/commit/d0508518a9
2024-01-19[rubygems/rubygems] Test that regular gems don't shadow default gemsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/b8ca5950a6
2024-01-18[PRISM] Fix case splat with no predicateMatt Valentine-House
2024-01-18[ruby/psych] Add :stringify_names option to convert symbol keys to string ↵Robert Schulze
for dumping https://github.com/ruby/psych/commit/3d051d89aa
2024-01-18[ruby/stringio] Fix ascii_only? flag in strio_writetomoya ishida
(https://github.com/ruby/stringio/pull/77) Followup of #79 `rb_str_resize()` was changed by https://github.com/ruby/ruby/commit/b0b9f7201acab05c2a3ad92c3043a1f01df3e17f . ```c rb_str_resize(string, shorter) // clear ENC_CODERANGE in some case rb_str_resize(string, longer) // does not clear ENC_CODERANGE anymore ``` ```c // rb_str_resize in string.c if (slen > len && ENC_CODERANGE(str) != ENC_CODERANGE_7BIT) { ENC_CODERANGE_CLEAR(str); } ``` I think this change is based on an assumption that appending null bytes will not change flag `ascii_only?`. `strio_extend()` will make the string longer if needed, and update the flags correctly for appending null bytes. Before `memmove()`, we need to `rb_str_modify()` because updated flags are not updated for `memmove()`. https://github.com/ruby/stringio/commit/b31a538576
2024-01-18Skip bigdecimal extension on TestExtLibsHiroshi SHIBATA
2024-01-18Extract bigdecimal as bundled gemsHiroshi SHIBATA
2024-01-17[Prism] Implement defined? for PM_UNLESS_NODEeileencodes
Ruby code: ```ruby defined?(unless true; 1; end) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_UNTIL_NODEeileencodes
Ruby code: ```ruby defined?(until a == 1; end) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_WHILE_NODEeileencodes
Ruby code: ```ruby defined?(while a != 1; end) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_SINGLETON_CLASS_NODEeileencodes
Ruby code: ```ruby defined?(class << self; end) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_RATIONAL_NODEeileencodes
Ruby code: ```ruby defined?(1.2r) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_MODULE_NODEeileencodes
Ruby code: ```ruby defined?(module M; end) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_MATCH_REQUIRED_NODEeileencodes
Ruby code: ```ruby defined?(1 => 1) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_MATCH_WRITE_NODEeileencodes
Ruby code: ```ruby defined?(/(?<foo>bar)/ =~ 'barbar') ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,35)> local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 1] foo@0 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,35)> local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 1] foo@0 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_IF_NODEeileencodes
Ruby code: ```ruby defined?(if true; 1; end) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,43)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,43)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_FOR_NODEeileencodes
Ruby code: ```ruby defined?(for i in [1,2] do; i; end) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,43)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,43)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_DEF_NODEeileencodes
Ruby code: ```ruby defined?(def prism_test_def_node; end) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,43)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,43)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_CLASS_NODEeileencodes
Ruby code: ```ruby defined?(class PrismClassA; end) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,43)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,43)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_CASE_MATCH_NODEeileencodes
Ruby code: ```ruby defined?(case [1, 2, 3]; in [1, 2, 3]; 4; end) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,43)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,43)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_CASE_NODEeileencodes
Ruby code: ```ruby defined?(case :a; when :a; 1; else; 2; end) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,43)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,43)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[PRISM] Fix test spelling `RescueModifer` -> `RescueModifier`eileencodes
`RescueModifier` was spelled wrong. Not a big deal, but it meant I didn't immediately find the test when I was searching for it while working on implementing `defined?` nodes.
2024-01-17[Prism] Implement defined? for PM_INDEX_OR_WRITE_NODEeileencodes
Ruby code: ```ruby defined?([0][0] ||= 1) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)> 0000 putobject "assignment" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)> 0000 putobject "assignment" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_INDEX_OPERATOR_WRITE_NODEeileencodes
Ruby code: ```ruby defined?([0][0] += 1) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)> 0000 putobject "assignment" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)> 0000 putobject "assignment" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_INDEX_AND_WRITE_NODEeileencodes
Ruby code: ```ruby defined?([0][0] &&= 1) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)> 0000 putobject "assignment" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)> 0000 putobject "assignment" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_CONSTANT_PATH_WRITE_NODEeileencodes
Ruby code: ```ruby defined?(Prism::CPWN = 1) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)> 0000 putobject "assignment" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)> 0000 putobject "assignment" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_CONSTANT_PATH_OR_WRITE_NODEeileencodes
Ruby code: ```ruby defined?(Prism::CPOrWN ||= 1) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)> 0000 putobject "assignment" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)> 0000 putobject "assignment" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_CONSTANT_PATH_OPERATOR_WRITE_NODEeileencodes
Ruby code: ```ruby defined?(Prism::CPOWN += 1) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)> 0000 putobject "assignment" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)> 0000 putobject "assignment" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_CONSTANT_PATH_AND_WRITE_NODEeileencodes
Ruby code: ```ruby defined?(Prism::CPAWN &&= 1) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)> 0000 putobject "assignment" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)> 0000 putobject "assignment" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_CALL_OR_WRITE_NODEeileencodes
Ruby code: ```ruby defined?(PrismTestSubclass.test_call_or_write_node ||= 1) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)> 0000 putobject "assignment" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)> 0000 putobject "assignment" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_CALL_OPERATOR_WRITE_NODEeileencodes
Ruby code: ```ruby defined?(PrismTestSubclass.test_call_operator_write_node += 1) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)> 0000 putobject "assignment" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)> 0000 putobject "assignment" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[Prism] Implement defined? for PM_CALL_AND_WRITE_NODEeileencodes
Ruby code: ```ruby defined?(PrismTestSubclass.test_call_and_write_node &&= 1) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,58)> 0000 putobject "assignment" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,58)> 0000 putobject "assignment" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
2024-01-17[PRISM] Fix crash in compile_prismPeter Zhu
If the argument is not a file or a string, it assumes it's a string which will crash because RSTRING_PTR and RSTRING_LEN assumes it's a string.
2024-01-17[PRISM] Fix fallthrough for PM_ENSURE_NODEPeter Zhu
This caused it to fall into PM_ELSE_NODE which caused ensure nodes to be compiled twice. Fixes ruby/prism#2176.
2024-01-17[ruby/prism] Test version: 3.3.0Takashi Kokubun
https://github.com/ruby/prism/commit/94ecb366c4
2024-01-17[ruby/prism] Fix => ^itTakashi Kokubun
https://github.com/ruby/prism/commit/24a2872b4e
2024-01-17[ruby/prism] Parse `it` default parameterTakashi Kokubun
https://github.com/ruby/prism/commit/a0c5361b9f
2024-01-17[ruby/openssl] test/openssl/test_ocsp.rb: fix flaky testKazuki Yamaguchi
Fixes: https://github.com/ruby/openssl/issues/695 https://github.com/ruby/openssl/commit/95281fe4a9