summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-06-18ast.rb: RubyVM::AST.parse and .of accepts `save_script_lines: true`Yusuke Endoh
This option makes the parser keep the original source as an array of the original code lines. This feature exploits the mechanism of `SCRIPT_LINES__` but records only the specified code that is passed to RubyVM::AST.of or .parse, instead of recording all parsed program texts. Notes: Merged: https://github.com/ruby/ruby/pull/4581
2021-06-17[rubygems/rubygems] Close then unlink tempfiles on WindowsNobuyoshi Nakada
In ruby/ruby test actions, number of "leaked tempfile" messages are shown on Windows. As Windows disallows removing open files, `Tempfile#unlink` fails silently before `#close`. Close then unlink by `#close!` instead. https://github.com/rubygems/rubygems/commit/fe0b88ac30
2021-06-15Time#getlocal tests for [Feature #17544]Nobuyoshi Nakada
2021-06-14[Bug #17880] Set leaf false on opt_setinlinecache (#4565)Eileen M. Uchitelle
This change fixes the bug described in https://bugs.ruby-lang.org/issues/17880. Checking `ractor_shareable_p` will cause the method to call back into Ruby. Anything calling this method can't be a leaf instruction, otherwise it could crash. By adding `attr bool leaf = false` we no longer crash because it marks the function as not a leaf. Here's a simplified reproduction script: ```ruby require "set" class Id attr_reader :db_id def initialize(db_id) @db_id = db_id end def ==(other) other.class == self.class && other.db_id == db_id end alias_method :eql?, :== def hash 10 end def <=>(other) db_id <=> other.db_id if other.is_a?(self.class) end end class Namespace IDS = Set[ Id.new(1).freeze, Id.new(2).freeze, Id.new(3).freeze, Id.new(4).freeze, ].freeze class << self def test?(id) IDS.include?(id) end end end p Namespace.test?(Id.new(1)) p Namespace.test?(Id.new(5)) ``` Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2021-06-14[lib/ostruct] Fix YAML testMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/4572
2021-06-14[lib/ostruct] Allow overriding of `block_given?`Marc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/4572
2021-06-15Suppress exception report in inner threadNobuyoshi Nakada
2021-06-15Close leaked file descriptorsNobuyoshi Nakada
2021-06-14Add fallback block to `OpenStruct#delete_field` (#1409)jfrazx
Notes: Merged-By: marcandre <github@marc-andre.ca>
2021-06-14Fix fiber scheduler address resolve solaris testsBruno Sutic
Notes: Merged: https://github.com/ruby/ruby/pull/4571
2021-06-14Wake up join list within thread EC context. (#4471)Samuel Williams
* Wake up join list within thread EC context. * Consume items from join list so that they are not re-executed. If `rb_fiber_scheduler_unblock` raises an exception, it can result in a segfault if `rb_threadptr_join_list_wakeup` is not within a valid EC. This change moves `rb_threadptr_join_list_wakeup` into the thread's top level EC which initially caused an infinite loop because on exception will retry. We explicitly remove items from the thread's join list to avoid this situation. * Verify the required scheduler interface. * Test several scheduler hooks methods with broken `unblock` implementation. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2021-06-14Add scheduler hook `Addrinfo.getaddrinfo`. (#4375)Samuel Williams
Co-authored-by: Bruno Sutic <code@brunosutic.com> Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2021-06-08Make ENV.clone warn and ENV.dup raiseJeremy Evans
ENV.dup returned a plain Object, since all of ENV's behavior is defined in ENV's singleton class. So using dup makes no sense. ENV.clone works and is used in some gems, but it doesn't do what the user expects, since modifying ENV.clone also modifies ENV. Add a deprecation warning pointing the user to use ENV.to_h instead. This also undefines some private initialize* methods in ENV, since they are not needed. Fixes [Bug #17767] Notes: Merged: https://github.com/ruby/ruby/pull/4557 Merged-By: jeremyevans <code@jeremyevans.net>
2021-06-08[ruby/psych] Fix the test that does not work with libyaml-0.1.7Yusuke Endoh
https://github.com/ruby/psych/commit/542cf9754f
2021-06-07Do not use YAML module in tests of PsychHiroshi SHIBATA
2021-06-07Use assert_raise instead of assert_raisesHiroshi SHIBATA
2021-06-07[ruby/psych] Implement YAML.safe_dump to make safe_load more usable.Jean Boussier
In case where Psych is used as a two way serializers, e.g. to serialize some cache or config, it is preferable to have the same restrictions on both load and dump. Otherwise you might dump and persist some objects payloads that you later won't be able to read. https://github.com/ruby/psych/commit/441958396f
2021-06-03Warn more duplicate literal hash keysNobuyoshi Nakada
Following non-special_const literals: * T_REGEXP Notes: Merged: https://github.com/ruby/ruby/pull/4548
2021-06-03Warn more duplicate literal hash keysNobuyoshi Nakada
Following non-special_const literals: * T_BIGNUM * T_FLOAT (non-flonum) * T_RATIONAL * T_COMPLEX Notes: Merged: https://github.com/ruby/ruby/pull/4548
2021-06-03Assertions for duplicate literal hash key warningsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4548
2021-06-03[rubygems/rubygems] Rename test/rubygems/test_{case,utilities}.rb to avoid ↵Yusuke Endoh
"test_" prefix This changes "test/rubygems/test_case.rb" to "test/rubygems/helper.rb", and "test/rubygems/test_utilities.rb" to "test/rubygems/utilities.rb". The two files are a helper for tests, not test files. However, a file starting with "test_" prefix is handled as a test file directly loaded by test-unit because Rakefile specifies: ``` t.test_files = FileList['test/**/test_*.rb'] ``` Directly loading test/rubygems/test_utilities.rb caused "uninitialized constant Gem::TestCase". This issue was fixed by 59c682097197fee4052b47e4b4ab86562f3eaa9b, but the fix caused a "circular require" warning because test_utilities.rb and test_case.rb are now requiring each other. Anyway, adding "test_" prefix to a test helper file is confusing, so this changeset reverts the fix and solve the issue by renaming them. https://github.com/rubygems/rubygems/commit/6460e018df
2021-06-02[ruby/rdoc] Add an alias for test-unit with older versions of RubyGemsaycabta
https://github.com/ruby/rdoc/commit/b8d68fdd87
2021-06-01Make `Thread#native_thread_id` not-implemented if unsupportedNobuyoshi Nakada
Raise `NotImplementedError` on unsupported platforms regardless the argument consistently.
2021-05-31The test for command injection on Unix platforms should be omitted on Windowsaycabta
2021-05-29Attempt to fix floating point test failureJeremy Evans
The previous behavior depending on exact float values, it seemed to work OK on amd64 and i386, but other CI platforms are experiencing non-deterministic test failures with it. Relax test slightly to hopefully pass on such platforms.
2021-05-29Fix Enumerator::ArithmeticSequence handling of float rangesJeremy Evans
Depending on the float range, there could be an off-by-one error, where the last result that should be in the range was missed. Fix this by checking if the computed value for the expected value outside the range is still inside the range, and if so, increment the step size. Fixes [Bug #16612] Notes: Merged: https://github.com/ruby/ruby/pull/4434
2021-05-28compile.c: Emit send for === calls in when statementsAlan Wu
The checkmatch instruction with VM_CHECKMATCH_TYPE_CASE calls === without a call cache. Emit a send instruction to make the call instead. It includes a call cache. The call cache improves throughput of using when statements to check the class of a given object. This is useful for say, JSON serialization. Use of a regular send instead of checkmatch also avoids taking the VM lock every time, which is good for multi-ractor workloads. Calculating ------------------------------------- master post vm_case_classes 11.013M 16.172M i/s - 6.000M times in 0.544795s 0.371009s vm_case_lit 2.296 2.263 i/s - 1.000 times in 0.435606s 0.441826s vm_case 74.098M 64.338M i/s - 6.000M times in 0.080974s 0.093257s Comparison: vm_case_classes post: 16172114.4 i/s master: 11013316.9 i/s - 1.47x slower vm_case_lit master: 2.3 i/s post: 2.3 i/s - 1.01x slower vm_case master: 74097858.6 i/s post: 64338333.9 i/s - 1.15x slower The vm_case benchmark is a bit slower post patch, possibily due to the larger instruction sequence. The benchmark dispatches using opt_case_dispatch so was not running checkmatch and does not make the === call post patch. Notes: Merged: https://github.com/ruby/ruby/pull/4468
2021-05-28Resolve to missing `Gem::TestCase` issue with random order testsHiroshi SHIBATA
2021-05-28[rubygems/rubygems] Use pend instead of skipHiroshi SHIBATA
2021-05-28[rubygems/rubygems] Fix "instance variable not initialized" warningDavid Rodríguez
This variable had a typo (it's `@gemhome`), but the test is still passing, so I assume it's not needed. https://github.com/rubygems/rubygems/commit/3b88642bdb
2021-05-28[rubygems/rubygems] Test installing a non deprecated fileDavid Rodríguez
https://github.com/rubygems/rubygems/commit/a678959eda
2021-05-28[rubygems/rubygems] Remove no longer needed `RUBYGEMS_TEST_PATH` env variableDavid Rodríguez
https://github.com/rubygems/rubygems/commit/0efb894c3b
2021-05-28[rubygems/rubygems] Remove no longer relevant commentsºDavid Rodríguez
https://github.com/rubygems/rubygems/commit/8dfe1e30b5
2021-05-28[rubygems/rubygems] Require the new files in `test/` relativelyDavid Rodríguez
https://github.com/rubygems/rubygems/commit/c77868a555
2021-05-28[rubygems/rubygems] Copy files specific to testing rubygems to `test`David Rodríguez
https://github.com/rubygems/rubygems/commit/aa390a3500
2021-05-28[rubygems/rubygems] Try fix ruby-core CIHiroshi SHIBATA
* Port https://github.com/ruby/ruby/commit/8e91b969df08b7a2eb27a5d6d38733eea42dc7ad from ruby-core, and make it compatible with psych 3 & 4.
2021-05-27Fix lazy enumerator with index sizeJeremy Evans
Fixes [Bug #17889] Notes: Merged: https://github.com/ruby/ruby/pull/4534
2021-05-27Guard for the ftp protocol feature of OpenURIHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-27Defer to require prime for OpenSSL::TestBNHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-27Promote net-smtp to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-27Promote net-pop to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-27Promote net-imap to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-27Promote net-ftp to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-27Promote matrix to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-27Promote prime to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-26Rescue NotImplementedError for a test of Thread#native_thread_idYusuke Endoh
http://rubyci.s3.amazonaws.com/solaris10-gcc/ruby-master/log/20210526T070003Z.fail.html.gz ``` 1) Error: TestThread#test_thread_native_thread_id: NotImplementedError: native_thread_id() function is unimplemented on this machine /export/home/users/chkbuild/cb-gcc/tmp/build/20210526T070003Z/ruby/test/ruby/test_thread.rb:1338:in `native_thread_id' /export/home/users/chkbuild/cb-gcc/tmp/build/20210526T070003Z/ruby/test/ruby/test_thread.rb:1338:in `test_thread_native_thread_id' ```
2021-05-26Suppress debug messageNobuyoshi Nakada
2021-05-26Add Thread#native_thread_id [Feature #17853]NARUSE, Yui
2021-05-26RSS library is the bundled gems nowHiroshi SHIBATA
2021-05-26Ignore lib/irb/ext/tracer.rb with TestRequireLib because tracer library was ↵Hiroshi SHIBATA
removed from ruby repo