summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2024-10-02[ruby/fiddle] test: remove fragile memory leak testsSutou Kouhei
https://github.com/ruby/fiddle/commit/0bfcd02bef
2024-10-02[rubygems/rubygems] Standarize "ins" test command tooDavid Rodríguez
https://github.com/rubygems/rubygems/commit/517e9a8669
2024-10-02[rubygems/rubygems] Fix weirdness of "interrupt" test commandDavid Rodríguez
https://github.com/rubygems/rubygems/commit/0a75590ac9
2024-10-02[ruby/irb] Use correct binding in debug modetomoya ishida
(https://github.com/ruby/irb/pull/1007) In debug command, IRB's context was using wrong binding. Some code colorization, command detection failed because binding.local_variable returned wrong value. https://github.com/ruby/irb/commit/68f718de21
2024-10-01[ruby/prism] Disallow dynamic patterns in labels at top level followed by pipesKevin Newton
https://github.com/ruby/prism/commit/ccc746f918
2024-10-01[ruby/reline] Fix Reline crash with invalid encoding historytomoya ishida
(https://github.com/ruby/reline/pull/751) https://github.com/ruby/reline/commit/e9d4b37e34
2024-10-01Resync to latest PrismKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11753
2024-10-01[ruby/prism] Disallow &. after endless rangeKevin Newton
https://github.com/ruby/prism/commit/498dd922d4
2024-10-01[Bug #20764] Refactor argument forwarding in lambdaNobuyoshi Nakada
Reject argument forwarding in lambda: - without parentheses - after optional argument(s) Notes: Merged: https://github.com/ruby/ruby/pull/11751
2024-10-01[Bug #20755] Frozen string should not be writable via IO::BufferNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11738
2024-10-01Remove no longer needed excludes filesNobuyoshi Nakada
2024-10-01Fix compile issue with a short-circuited if/unless condition and `defined?`Luke Gruber
This caused an issue when `defined?` was in the `if` condition. Its instructions weren't appended to the instruction sequence even though it was compiled if a compile-time known logical short-circuit happened before the `defined?`. The catch table entry (`defined?` compilation produces a catch table entry) was still on the iseq even though the instructions weren't there. This caused faulty exception handling in the method. The solution is to no add the catch table entry for `defined?` after a compile-time known logical short circuit. This shouldn't touch much code, it's only for cases like the following, which can occur during debugging: if false && defined?(Some::CONSTANT) "more code..." end Fixes [Bug #20501] Notes: Merged: https://github.com/ruby/ruby/pull/11554
2024-09-30Sync Prism with latest main branchKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11741
2024-09-30[ruby/prism] Require a delimiter for singleton classesKevin Newton
https://github.com/ruby/prism/commit/fd58d6a9ea
2024-09-30[Bug #20752] Slice of readonly `IO::Buffer` also should be readonlyNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11735
2024-09-30Update test args with bundled gems. webrick has been removed that targetsHiroshi SHIBATA
2024-09-30Implement SPLAT NODE keyword locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11673
2024-09-30[rubygems/rubygems] Don't add duplicated specs to unresolved specsDavid Rodríguez
This could happen when a regular gem shadows a default gem. https://github.com/rubygems/rubygems/commit/9ef70dd1f7
2024-09-30[rubygems/rubygems] Don't list duplicated version in ↵David Rodríguez
`Gem::Specification.reset` warning https://github.com/rubygems/rubygems/commit/e6e3db821f
2024-09-28[rubygems/rubygems] Improve Gem::SpecFetcher tests.Ellen Marie Dash
https://github.com/rubygems/rubygems/commit/6e0456583b
2024-09-28[rubygems/rubygems] [tests] Don't expect suggestions that aren't actually ↵Ellen Marie Dash
helpful. https://github.com/rubygems/rubygems/commit/e7d6b92e31
2024-09-28Allow dot3 in defs singletontompng
Notes: Merged: https://github.com/ruby/ruby/pull/11716
2024-09-28Implement OP_ASGN2 NODE locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11702
2024-09-28[Bug #20763] Add testsNobuyoshi Nakada
2024-09-27[rubygems/rubygems] Warning about PATH in `--user-install` mode is only ↵David Rodríguez
necessary for gems with executables https://github.com/rubygems/rubygems/commit/2fe0f452a2
2024-09-27Implement OP_ASGN1 NODE locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11701
2024-09-26[ruby/prism] Reject non-assoc ranges with subsequent operatorsKevin Newton
https://github.com/ruby/prism/commit/976a3cd0a5
2024-09-25[ruby/prism] Fix up more error messages to more closely match parse.yKevin Newton
https://github.com/ruby/prism/commit/988ac82187
2024-09-25[ruby/prism] Fix up void value expression checking for rescueKevin Newton
https://github.com/ruby/prism/commit/509ff88e92
2024-09-25[ruby/prism] Disallow label in parenthesesKevin Newton
https://github.com/ruby/prism/commit/b624e09cc6
2024-09-25TestProcess#test_daemon_noclose is only working with macOS 15.1 beta, we ↵Hiroshi SHIBATA
should skip with macOS 15.0
2024-09-25Implement BLOCK_PASS NODE keyword locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11663
2024-09-25Implement RETURN NODE keyword locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11589
2024-09-24[ruby/irb] Use proper locale in history encoding testtomoya ishida
(https://github.com/ruby/irb/pull/1008) https://github.com/ruby/irb/commit/f6b06a9a40
2024-09-24[ruby/error_highlight] Fix error with prism when method given no argumentsLuke Gruber
such as: p = Proc.new This now matches the RubyVM::AbstractSyntaxTree behavior, which is not to highlight anything. https://github.com/ruby/error_highlight/commit/d5c592a1ba
2024-09-24[ruby/prism] Accept version shorthand like 3.4Kevin Newton
https://github.com/ruby/prism/commit/098f1c4607
2024-09-24[ruby/prism] Accept all 3.3.x and 3.4.x Ruby versions for Prism.parseBenoit Daloze
https://github.com/ruby/prism/commit/a4fcd5339a
2024-09-24Windows: Use Unicode aware WinAPI function for ENV[]=Lars Kanis
This only makes a difference when setting an empty value to a Unicode key. Notes: Merged: https://github.com/ruby/ruby/pull/7034
2024-09-23Implement CASE3 NODE keyword locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11661
2024-09-23Implement CASE2 NODE keyword locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11661
2024-09-23Implement CASE NODE keyword locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11661
2024-09-21Make Complex#{inspect,to_s} work correctly if real part #inspect returns ↵Jeremy Evans
frozen string Make static f_format function take a non-frozen string to append to. This does not result in an additional allocation for #inspect, but it does result in an additional allocation for #to_s. Fixes [Bug #20337] Notes: Merged: https://github.com/ruby/ruby/pull/11657
2024-09-20[ruby/prism] Fix `kDO_LAMBDA` token incompatibility for ↵Koichi ITO
`Prism::Translation::Parser::Lexer` ## Summary This PR fixes `kDO_LAMBDA` token incompatibility between Parser gem and `Prism::Translation::Parser` for lambda `do` block. ### Parser gem (Expected) Returns `kDO_LAMBDA` token: ```console $ bundle exec ruby -Ilib -rparser/ruby33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-> do end"; p Parser::Ruby33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tLAMBDA, ["->", #<Parser::Source::Range example.rb 0...2>]], [:kDO_LAMBDA, ["do", #<Parser::Source::Range example.rb 3...5>]], [:kEND, ["end", #<Parser::Source::Range example.rb 6...9>]]] ``` ### `Prism::Translation::Parser` (Actual) Previously, the parser returned `kDO` token when parsing the following: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-> do end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tLAMBDA, ["->", #<Parser::Source::Range example.rb 0...2>]], [:kDO, ["do", #<Parser::Source::Range example.rb 3...5>]], [:kEND, ["end", #<Parser::Source::Range example.rb 6...9>]]] ``` After the update, the parser now returns `kDO_LAMBDA` token for the same input: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-> do end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tLAMBDA, ["->", #<Parser::Source::Range example.rb 0...2>]], [:kDO_LAMBDA, ["do", #<Parser::Source::Range example.rb 3...5>]], [:kEND, ["end", #<Parser::Source::Range example.rb 6...9>]]] ``` ## Additional Information Unfortunately, this kind of edge case doesn't work as expected; `kDO` is returned instead of `kDO_LAMBDA`. However, since `kDO` is already being returned in this case, there is no change in behavior. ### Parser gem Returns `tLAMBDA` token: ```console $ bundle exec ruby -Ilib -rparser/ruby33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-> (foo = -> (bar) {}) do end"; p Parser::Ruby33.new.tokenize(buf)[2]' ruby 3.3.5 (2024-09-03 revision https://github.com/ruby/prism/commit/ef084cc8f4) [x86_64-darwin23] [[:tLAMBDA, ["->", #<Parser::Source::Range example.rb 0...2>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 3...4>]], [:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 4...7>]], [:tEQL, ["=", #<Parser::Source::Range example.rb 8...9>]], [:tLAMBDA, ["->", #<Parser::Source::Range example.rb 10...12>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 13...14>]], [:tIDENTIFIER, ["bar", #<Parser::Source::Range example.rb 14...17>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 17...18>]], [:tLAMBEG, ["{", #<Parser::Source::Range example.rb 19...20>]], [:tRCURLY, ["}", #<Parser::Source::Range example.rb 20...21>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 21...22>]], [:kDO_LAMBDA, ["do", #<Parser::Source::Range example.rb 23...25>]], [:kEND, ["end", #<Parser::Source::Range example.rb 26...29>]]] ``` ### `Prism::Translation::Parser` Returns `kDO` token: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "-> (foo = -> (bar) {}) do end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.3.5 (2024-09-03 revision https://github.com/ruby/prism/commit/ef084cc8f4) [x86_64-darwin23] [[:tLAMBDA, ["->", #<Parser::Source::Range example.rb 0...2>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 3...4>]], [:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 4...7>]], [:tEQL, ["=", #<Parser::Source::Range example.rb 8...9>]], [:tLAMBDA, ["->", #<Parser::Source::Range example.rb 10...12>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 13...14>]], [:tIDENTIFIER, ["bar", #<Parser::Source::Range example.rb 14...17>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 17...18>]], [:tLAMBEG, ["{", #<Parser::Source::Range example.rb 19...20>]], [:tRCURLY, ["}", #<Parser::Source::Range example.rb 20...21>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 21...22>]], [:kDO, ["do", #<Parser::Source::Range example.rb 23...25>]], [:kEND, ["end", #<Parser::Source::Range example.rb 26...29>]]] ``` As the intention is not to address such special cases at this point, a comment has been left indicating that this case still returns `kDO`. In other words, `kDO_LAMBDA` will now be returned except for edge cases after this PR. https://github.com/ruby/prism/commit/2ee480654c
2024-09-20[ruby/prism] Introduce partial_script optionKevin Newton
https://github.com/ruby/prism/commit/b28877fa4f
2024-09-20[rubygems/rubygems] Unconditionally set installed_by_versionSamuel Giddins
It has been supported since RubyGems 2.2.0 via https://github.com/rubygems/rubygems/commit/4525e45a4d45 Signed-off-by: Samuel Giddins <segiddins@segiddins.me> https://github.com/rubygems/rubygems/commit/bf39c583e8
2024-09-20[ruby/irb] Fix debug command in nomultiline modetomoya ishida
(https://github.com/ruby/irb/pull/1006) * Fix debug command in nomultiline mode * context.colorize_code -> context.colorize_input https://github.com/ruby/irb/commit/71f4d6bfb5
2024-09-20[Bug #18651] Pass undefined region in CP51932 as is to CP50220Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5696
2024-09-19Fix method caching bug when including/prepend module A that prepends module BJeremy Evans
Fix by always adding the generated iclass to the subclasses list, otherwise the method cache for the iclass is not cleared when the method in the module is overwritten. Fixes [Bug #20716] Notes: Merged: https://github.com/ruby/ruby/pull/11582
2024-09-18Raise a compile error for break/next/redo inside eval in cases where it is ↵Jeremy Evans
optimized away In cases where break/next/redo are not valid syntax, they should raise a SyntaxError even if inside a conditional block that is optimized away. Fixes [Bug #20597] Co-authored-by: Kevin Newton <kddnewton@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/11099 Merged-By: jeremyevans <code@jeremyevans.net>
2024-09-18Fix evaluation order issue in f(**h, &h.delete(key))Jeremy Evans
Previously, this would delete the key in `h` before keyword splatting `h`. This goes against how ruby handles `f(*a, &a.pop)` and similar expressions. Fix this by having the compiler check whether the block pass expression is safe. If it is not safe, then dup the keyword splatted hash before evaluating the block pass expression. For expression: `h=nil; f(**h, &h.delete(:key))` VM instructions before: ``` 0000 putnil ( 1)[Li] 0001 setlocal_WC_0 h@0 0003 putself 0004 getlocal_WC_0 h@0 0006 getlocal_WC_0 h@0 0008 putobject :key 0010 opt_send_without_block <calldata!mid:delete, argc:1, ARGS_SIMPLE> 0012 splatkw 0013 send <calldata!mid:f, argc:1, ARGS_BLOCKARG|FCALL|KW_SPLAT>, nil 0016 leave ``` VM instructions after: ``` 0000 putnil ( 1)[Li] 0001 setlocal_WC_0 h@0 0003 putself 0004 putspecialobject 1 0006 newhash 0 0008 getlocal_WC_0 h@0 0010 opt_send_without_block <calldata!mid:core#hash_merge_kwd, argc:2, ARGS_SIMPLE> 0012 getlocal_WC_0 h@0 0014 putobject :key 0016 opt_send_without_block <calldata!mid:delete, argc:1, ARGS_SIMPLE> 0018 send <calldata!mid:f, argc:1, ARGS_BLOCKARG|FCALL|KW_SPLAT|KW_SPLAT_MUT>, nil 0021 leave ``` This is the same as 07d3bf4832532ae7446c9a6924d79aed60a7a9a5, except that it removes unnecessary hash allocations when using the prism compiler. Fixes [Bug #20640] Notes: Merged: https://github.com/ruby/ruby/pull/11645 Merged-By: jeremyevans <code@jeremyevans.net>