summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2024-10-10[ruby/prism] Prism::CodeUnitsCacheKevin Newton
Calculating code unit offsets for a source can be very expensive, especially when the source is large. This commit introduces a new class that wraps the source and desired encoding into a cache that reuses pre-computed offsets. It performs quite a bit better. There are still some problems with this approach, namely character boundaries and the fact that the cache is unbounded, but both of these may be addressed in subsequent commits. https://github.com/ruby/prism/commit/2e3e1a4d4d
2024-10-10Fix typo in test_gc.rb [ci skip]Peter Zhu
2024-10-10[ruby/prism] Do not warn for unused variables on negative linesKevin Newton
Fixes [Bug #20788] https://github.com/ruby/prism/commit/27e91f21af
2024-10-10[rubygems/rubygems] Fix `gem pristine etc` resetting gem twice sometimesDavid Rodríguez
If a default version and a regular version of etc are present at the same time, RubyGems will end up duplicating work and running pristine twice. The `etc` gem is special because it's loaded by RubyGems by default. When doing this, RubyGems will activate the regularly installed version. The when `gem pristine` runs, it will find to installed specifications but materialize both to the already activated specification. Before: ``` $ gem pristine etc --version 1.4.3 Restoring gems to pristine condition... Building native extensions. This could take a while... Restored etc-1.4.3 Building native extensions. This could take a while... Restored etc-1.4.3 ``` After: ``` $ gem pristine etc --version 1.4.3 Restoring gems to pristine condition... Skipped etc-1.4.3, it is a default gem Building native extensions. This could take a while... Restored etc-1.4.3 ``` https://github.com/rubygems/rubygems/commit/5c279ac56b
2024-10-10[rubygems/rubygems] Improve some indentationsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/30f228a97f
2024-10-10[rubygems/rubygems] Run specs that now pass on JRubyDavid Rodríguez
https://github.com/rubygems/rubygems/commit/2af077ee38
2024-10-10[ruby/prism] Reject invalid splat as last statement of parenthesesKevin Newton
https://github.com/ruby/prism/commit/3a0b1c6110
2024-10-10[ruby/fiddle] Only print Fiddle::VERSION when flag is trueHiroshi SHIBATA
(https://github.com/ruby/fiddle/pull/151) The test of current HEAD revision occurred `unknown command` on `ruby/ruby` repo. ``` $ make test-all -j TESTS="fiddle -j12" MSPECOPT="-j" (snip) # Running tests: unknown command: "Fiddle::VERSION: 1.1.3.dev"8681=test_fiddle 58682=test_pack 58683=test_handle 58684=test_import 58685=test_c_union_entity 58686:waiting 58687=test_pinne unknown command: "Fiddle::VERSION: 1.1.3.dev"8681=test_fiddle 58682=test_pack 58683=test_handle 58684=test_import 58685=test_c_union_entity 58686=test_cparser 58687=test_ unknown command: "Fiddle::VERSION: 1.1.3.dev"8681=test_fiddle 58682=test_pack 58683=test_handle 58684=test_import 58685=test_c_union_entity 58686=test_cparser 58687=test_ unknown command: "Fiddle::VERSION: 1.1.3.dev"8681=test_fiddle 58682=test_memory_view 58683=test_handle 58684=test_import 58685=test_c_union_entity 58686=test_cparser 5868 unknown command: "Fiddle::VERSION: 1.1.3.dev"8681=test_closure 58682=test_memory_view 58683=test_handle 58684=test_import 58685=test_c_union_entity 58686=test_cparser 586 unknown command: "Fiddle::VERSION: 1.1.3.dev" unknown command: "Fiddle::VERSION: 1.1.3.dev" unknown command: "Fiddle::VERSION: 1.1.3.dev"8681=test_closure 58682=test_memory_view 58683=test_handle 58684=test_import 58685=test_c_struct_builder 58686=test_cparser 5 unknown command: "Fiddle::VERSION: 1.1.3.dev"8681=test_closure 58682=test_memory_view 58683=test_handle 58684=test_import 58685=test_c_struct_builder 58686=test_cparser 5 unknown command: "Fiddle::VERSION: 1.1.3.dev"8681=test_closure 58682=test_memory_view 58683=test_handle 58684=test_import 58685=test_c_struct_builder 58686=test_cparser 5 Finished tests in 1.136194s, 194.5090 tests/s, 929.4187 assertions/s. 221 tests, 1056 assertions, 0 failures, 0 errors, 4 skips ``` I only show fiddle version in this repository with `$VERSBOSE` flag. https://github.com/ruby/fiddle/commit/31bebd85be
2024-10-10Revert "Commented out to print fiddle version"Hiroshi SHIBATA
This reverts commit a1db8dbe166d82d7238b3d375344799e057dab2b.
2024-10-10test/resolv/test_dns.rb: Keep `UDPSocket`s until a free port is foundYusuke Endoh
Follow up to 589f1978d8c368b8eccf34453463ad46a58d36da I suspect `UDPSocket.new` grabs the same port number because they are closed at each trial. Notes: Merged: https://github.com/ruby/ruby/pull/11863
2024-10-10Revert "TestProcess#test_daemon_noclose is only working with macOS 15.1 ↵Yuta Saito
beta, we should skip with macOS 15.0" This reverts commit 3830bca5edd6964131971866c80107c89fac5362. Notes: Merged: https://github.com/ruby/ruby/pull/11849
2024-10-10Suppress warnings with `RUBYPOT=-w`Nobuyoshi Nakada
``` -:3: warning: assigned but unused variable - var -:3: warning: assigned but unused variable - var -:3: warning: assigned but unused variable - var -:3: warning: assigned but unused variable - var -:3: warning: assigned but unused variable - var -:3: warning: assigned but unused variable - var ```
2024-10-10Commented out to print fiddle versionHiroshi SHIBATA
2024-10-10Emit warning for other method redefinition typesThomas Marshall
This commit ensures warnings about `object_id` and `__send__` method redefinitions are emitted for other method types such as aliases, procs, and attr readers—anything except C functions.
2024-10-10Make test_hash_symbol_colon_key pass on LANG=en_USYusuke Endoh
It failed on a platform with LANG=en_US ``` 1) Failure: PPTestModule::PPSingleLineTest#test_hash_symbol_colon_key [/home/chkbuild/chkbuild/tmp/build/20241010T010005Z/ruby/test/test_pp.rb:207]: <"{a: 1, a!: 1, a?: 1, \u3042: 1}"> expected but was <"{a: 1, a!: 1, a?: 1, \"\\u3042\": 1}">. ``` Notes: Merged: https://github.com/ruby/ruby/pull/11862
2024-10-10[ruby/fiddle] test jruby: fix a typoSutou Kouhei
https://github.com/ruby/fiddle/commit/d76c87b804 Notes: Merged: https://github.com/ruby/ruby/pull/11860
2024-10-10[ruby/fiddle] test jruby: fix a wrong messageSutou Kouhei
https://github.com/ruby/fiddle/commit/00b3521f5e Notes: Merged: https://github.com/ruby/ruby/pull/11860
2024-10-10[ruby/fiddle] test jruby: fix a typoSutou Kouhei
https://github.com/ruby/fiddle/commit/5bc55e0533 Notes: Merged: https://github.com/ruby/ruby/pull/11860
2024-10-10Import JRuby implementation (#147)Sutou Kouhei
Fix GH-104 lib/fiddle/jruby.rb is based on https://github.com/jruby/jruby/blob/master/lib/ruby/stdlib/fiddle/jruby.rb . Here are changes for it: * Move `Fiddle::TYPE_*` to `Fiddle::Types::*` * Add `Fiddle::Types::VARIADIC` * Add `Fiddle::Types::CONST_STRING` * Add `Fiddle::Types::BOOL` * Add `Fiddle::Types::INT8_T` * Add `Fiddle::Types::UINT8_T` * Add `Fiddle::Types::INT16_T` * Add `Fiddle::Types::UINT16_T` * Add `Fiddle::Types::INT32_T` * Add `Fiddle::Types::UINT32_T` * Add `Fiddle::Types::INT64_T` * Add `Fiddle::Types::UINT64_T` * Add more `Fiddle::ALIGN_*` for the above new `Fiddle::Types::*` * Add more `Fiddle::SIZEOF_*` for the above new `Fiddle::Types::*` * Add support for specifying type as not only `Fiddle::Types::*` but also `Symbol` like `:int` * Add support for variable size arguments in `Fiddle::Function` * Add `Fiddle::Closure#free` * Add `Fiddle::Closure#freed?` * Add `Fiddle::Error` as base the error class * Add `Fiddle::Pointer#call_free` and stop using `FFI::AutoPointer` in `Fiddle::Pointer` * Add support for `Fiddle::Pointer.malloc {}` `Fiddle::Pointer` * Add support for `Fiddle::Pointer#free=` * Add `Fiddle::Pointer#freed?` * Use binary string not C string for `Fiddle::Pointer#[]` * Add `Fiddle::Handle.sym_defined?` * Add `Fiddle::Handle#sym_defined?` * Add `Fiddle::Handle::DEFAULT` * Add `Fiddle::ClearedReferenceError` * Add no-op `Fiddle::Pinned` Some features are still "not implemented". So there are some "omit"s for JRuby in tests. Notes: Merged: https://github.com/ruby/ruby/pull/11860
2024-10-09[ruby/prism] Attempt to assume binary is UTF-8Kevin Newton
https://github.com/ruby/prism/commit/343197e4ff
2024-10-09[rubygems/rubygems] Remove unused variableDavid Rodríguez
https://github.com/rubygems/rubygems/commit/b31f33d55c
2024-10-09[Bug #20789] Fix an invalid syntax error when `->a=1...{}`ydah
https://bugs.ruby-lang.org/issues/20789 Notes: Merged: https://github.com/ruby/ruby/pull/11850
2024-10-09[ruby/prism] Avoid breaking code units offset on binary encodingVinicius Stock
https://github.com/ruby/prism/commit/25a4cf6794 Co-authored-by: Kevin Newton <kddnewton@users.noreply.github.com>
2024-10-09[rubygems/rubygems] Fix a `gem install` crash during "done installing" hooksDavid Rodríguez
It would happen when the gem is already installed to multiple GEM_PATHS. RubyGems was removing duplicate specs without considering the potentially different `base_dir`. That was causing the gem to be misidentified as not already installed, and a nil specification getting returned from the installer as a result, causing the crash. Solve it by making sure `Gem::Specification.all` really iterates through all the different specifications in all GEM_PATHs. https://github.com/rubygems/rubygems/commit/0d8c208f65
2024-10-09[rubygems/rubygems] Allow `gem pristine` to reset default gems tooDavid Rodríguez
https://github.com/rubygems/rubygems/commit/c9e665eb8a
2024-10-09Sync from ruby/win32-registryHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11791
2024-10-09mingw environment can't bind free port with 10 times. We should omit it ↵Hiroshi SHIBATA
instead of test failure. ``` 1) Error: TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback: Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 59677 D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer#initialize' D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer.new' D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TestResolvDNS#with_udp_and_tcp' D:/a/ruby/ruby/src/test/resolv/test_dns.rb:711:in 'TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback' 2) Error: TestResolvDNS#test_query_ipv4_address_truncated_tcp_fallback: Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 59689 D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer#initialize' D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer.new' D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TestResolvDNS#with_udp_and_tcp' D:/a/ruby/ruby/src/test/resolv/test_dns.rb:223:in 'TestResolvDNS#test_query_ipv4_address_truncated_tcp_fallback' ``` Notes: Merged: https://github.com/ruby/ruby/pull/11842
2024-10-08Specify use_ipv6 option for ipv4 testHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11828
2024-10-08Removed trailing spaceHiroshi SHIBATA
2024-10-08JSONPure: String#to_json should raise on invalid encodingJean Boussier
Fix: #344 This matches the ext behavior.
2024-10-08JSON::Pure fix strict modeJean Boussier
Followup: https://github.com/flori/json/pull/519 Fix: https://github.com/flori/json/issues/584
2024-10-07Update references to flori/jsonJean Boussier
Now that the repository was transfered, these links will become dead in a few months. Notes: Merged: https://github.com/ruby/ruby/pull/11820
2024-10-07[ruby/prism] Properly handle non-assoc operatorsKevin Newton
https://github.com/ruby/prism/commit/dbd5c929d6
2024-10-07[ruby/prism] Handle invalid commas in arguments, parameters, and arraysKevin Newton
https://github.com/ruby/prism/commit/023e894b74
2024-10-07[ruby/prism] Set contains_keywords flag for implicit gets($/, chomp: true) ↵Andrew Konchin
method call to handle -l CLI option https://github.com/ruby/prism/commit/717e41c87d
2024-10-07[Bug #20787] Check the separator in `IO#readline` as well as 3.2Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11811
2024-10-07[ruby/reline] Add cursor keys for application keypad mode to defaulttomoya ishida
key bindings (https://github.com/ruby/reline/pull/719) * Add SS3 arrow sequence to default key bindings * Remove wrong KDE arrow sequence https://github.com/ruby/reline/commit/546a42522e
2024-10-06[ruby/reline] Allow utf-8 safe meta key mapping in inputrctomoya ishida
(https://github.com/ruby/reline/pull/723) Readline's convert-meta setting is utf-8 unsafe. Allow assigning `"\M-char": key` to bind "\echar": key even if convert-meta is not enabled. https://github.com/ruby/reline/commit/9844b99c6e
2024-10-06[ruby/irb] Change default completor from regexp to auto, trytomoya ishida
TypeCompletor and fallback to RegexpCompletor. (https://github.com/ruby/irb/pull/1010) https://github.com/ruby/irb/commit/bb6a99d815
2024-10-05[ruby/reline] Fix tempfile leaksNobuyoshi Nakada
(https://github.com/ruby/reline/pull/757) https://github.com/ruby/reline/actions/runs/11187507536/job/31104699331#step:13:1064 ``` Children under /tmp/rubytest.m48l5o: * -rw------- 1 101 2024-10-02 17:43:51 +0000 rubyfile20241002-60503-bhbfgq ``` https://github.com/ruby/reline/commit/1287f97a6f
2024-10-05[ruby/reline] Hash#inspect style has changed in ruby 3.4Nobuyoshi Nakada
[[Bug #20433]](https://bugs.ruby-lang.org/issues/20433) https://github.com/ruby/reline/commit/ca457ffb70
2024-10-05[ruby/irb] Hash#inspect style has changed in ruby 3.4Nobuyoshi Nakada
[[Bug #20433]](https://bugs.ruby-lang.org/issues/20433) https://github.com/ruby/irb/commit/ecd08a527e
2024-10-05[Bug #20705] Update `strtod` implementationNobuyoshi Nakada
The absence of either the integer or fractional part should be allowed. Notes: Merged: https://github.com/ruby/ruby/pull/11807
2024-10-05[Bug #20784] Fix incomplete character syntax followed by EOFtompng
Notes: Merged: https://github.com/ruby/ruby/pull/11805
2024-10-04[ruby/reline] Concatenate some rendeing testtomoya ishida
(https://github.com/ruby/reline/pull/749) https://github.com/ruby/reline/commit/41b54140f4
2024-10-04Fix intermediate array off-by-one errorKevin Newton
Co-authored-by: Adam Hess <HParker@github.com> Notes: Merged: https://github.com/ruby/ruby/pull/11800
2024-10-04[ruby/prism] Fix up multi target parsingKevin Newton
https://github.com/ruby/prism/commit/80cd335222
2024-10-04Allow method chaining with Pathname#mkpathschneems
Currently in my code when I want to create a pathname object and create a path at the same time I must use tap ``` path = Pathname.new("/tmp/new").tap(&:mkpath) ``` I think it would be cleaner to be able to chain on the results of these methods instead: ``` path = Pathname.new("/tmp/new").mkpath ``` Notes: Merged: https://github.com/ruby/ruby/pull/3705
2024-10-04Introduce Pathname.mktmpdirschneems
When I want to create a tmpdir I often want to manipulate it as a pathname. By introducing Pathname.mktmpdir I can get this behavior. Currently I must: ```ruby Dir.mktmpdir do |dir| dir = Pathname(dir) # ... code end ``` I would like to be able to instead: ```ruby Pathname.mktmpdir do |dir| # ... code end ``` Notes: Merged: https://github.com/ruby/ruby/pull/3709
2024-10-03Rename size_pool -> heapMatt Valentine-House
Now that we've inlined the eden_heap into the size_pool, we should rename the size_pool to heap. So that Ruby contains multiple heaps, with different sized objects. The term heap as a collection of memory pages is more in memory management nomenclature, whereas size_pool was a name chosen out of necessity during the development of the Variable Width Allocation features of Ruby. The concept of size pools was introduced in order to facilitate different sized objects (other than the default 40 bytes). They wrapped the eden heap and the tomb heap, and some related state, and provided a reasonably simple way of duplicating all related concerns, to provide multiple pools that all shared the same structure but held different objects. Since then various changes have happend in Ruby's memory layout: * The concept of tomb heaps has been replaced by a global free pages list, with each page having it's slot size reconfigured at the point when it is resurrected * the eden heap has been inlined into the size pool itself, so that now the size pool directly controls the free_pages list, the sweeping page, the compaction cursor and the other state that was previously being managed by the eden heap. Now that there is no need for a heap wrapper, we should refer to the collection of pages containing Ruby objects as a heap again rather than a size pool Notes: Merged: https://github.com/ruby/ruby/pull/11771