summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2019-11-08Fix typoKazuki Tsujimoto
2019-11-08Define Struct#deconstruct_keysKazuki Tsujimoto
2019-11-08use builtin for TracePoint.Koichi Sasada
Define TracePoint in trace_point.rb and use __builtin_ syntax. Notes: Merged: https://github.com/ruby/ruby/pull/2655
2019-11-07Add a counter for compactionAaron Patterson
Keep track of the number of times the compactor ran. I would like to use this as a way to keep track of inline cache reference updates.
2019-11-07Use a monotonically increasing number for object_idJohn Hawthorn
This changes object_id from being based on the objects location in memory (or a nearby memory location in the case of a conflict) to be based on an always increasing number. This number is a Ruby Integer which allows it to overflow the size of a pointer without issue (very unlikely to happen in real programs especially on 64-bit, but a nice guarantee). This changes obj_to_id_tbl and id_to_obj_tbl to both be maps of Ruby objects to Ruby objects (previously they were Ruby object to C integer) which simplifies updating them after compaction as we can run them through gc_update_table_refs. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2019-11-07Disallow duplicated pattern variableKazuki Tsujimoto
2019-11-06Revert "Use a monotonically increasing number for object_id"Aaron Patterson
This reverts commit bd2b314a05ae9192b3143e1e678a37c370d8a9ce.
2019-11-06Use a monotonically increasing number for object_idJohn Hawthorn
This changes object_id from being based on the objects location in memory (or a nearby memory location in the case of a conflict) to be based on an always increasing number. This number is a Ruby Integer which allows it to overflow the size of a pointer without issue (very unlikely to happen in real programs especially on 64-bit, but a nice guarantee). This changes obj_to_id_tbl and id_to_obj_tbl to both be maps of Ruby objects to Ruby objects (previously they were Ruby object to C integer) which simplifies updating them after compaction as we can run them through gc_update_table_refs. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/2638
2019-11-06Numbered parameter is an ID_LOCAL now [Bug #16293]Nobuyoshi Nakada
2019-11-06Numbered parameter cannot appear outside block now [Bug #16293]Nobuyoshi Nakada
2019-11-06Prohibit calling undefined allocator [Bug #16297]Nobuyoshi Nakada
2019-11-06Undefine MatchData.allocate [Feature #16294]Nobuyoshi Nakada
2019-11-05Assert return value of Readline.readline only if Ruby is before 2.7aycabta
2019-11-05Revert "[EXPERIMENTAL] Make Symbol#to_s return a frozen String [Feature #16150]"NARUSE, Yui
This reverts commit 6ffc045a817fbdf04a6945d3c260b55b0fa1fd1e.
2019-11-04[ruby/racc] Strip trailing whitespaces at the last line of actionsNobuyoshi Nakada
https://github.com/ruby/racc/commit/a887ebe529
2019-11-03Added assertions for linebreakNobuyoshi Nakada
2019-11-03Revert nil error and adding deprecation messageKenichi Kamiya
Notes: Merged: https://github.com/ruby/ruby/pull/2637
2019-11-01[ruby/date] Add more timezone abbreviationsJeremy Evans
This gets the time zone abbreviations from https://www.timeanddate.com/time/zones/, and adds unambiguous time zones not already present in zonetab.list. See bin/update-abbr for the program used. This regenerates zonetab.h using prereq.mk (requires gperf). Only one test line is added, just to make sure a new time zone abbreviation is picked up. Fixes Ruby Bug 16286 https://github.com/ruby/date/commit/702e8b3033
2019-10-31[ruby/zlib] Fix setting mtime to zero in GzipWriterAlan Wu
Before this change, it was not possible to write out zero for the timestamp part of a Gzip file's header, as calling GzipWriter#mtime with zero was ignored. Judging from the docs for `GzipWriter#mtime=`, it should be possible to indicate that no timestamp is available by calling the method with zero. https://github.com/ruby/zlib/commit/310be39cac
2019-10-31[ruby/stringio] Remove taint supportJeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. https://github.com/ruby/stringio/commit/60ee9ccd95
2019-10-31[ruby/date] Revert "Simplify #inspect"Jeremy Evans
This reverts commit af01edd7d8575f544f647dbe8cde5b6ae535d459. Revert requested by Yui Naruse. https://github.com/ruby/date/commit/875d563557
2019-10-31[ruby/date] introduce Date::Error, raise Date::Error for everyglaszig
"invalid <anything>" type of exception https://github.com/ruby/date/commit/3e55c09ba4
2019-10-31[ruby/zlib] Remove taint supportJeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. https://github.com/ruby/zlib/commit/21711ed0ce
2019-10-31Also ignore mswin platformHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/2635
2019-10-31Ignore test_racc_command with linux platformHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/2635
2019-10-31Try to run assert_output_unchanged with racc testsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/2635
2019-10-31Allow only one argument for keyword_init structAlan Wu
``` irb(main):001:0> RUBY_VERSION => "2.6.5" irb(main):002:0> S = Struct.new(:foo, keyword_init: true) => S(keyword_init: true) irb(main):003:0> S.new({foo: 23424}, 234) # I don't think this is intentional => #<struct S foo=23424> irb(main):004:0> ``` Tightening this up should inform users when they are confused about whether a struct is `keyword_init`. Notes: Merged: https://github.com/ruby/ruby/pull/2634
2019-10-30Regenerate the output results for test fixtures of raccHiroshi SHIBATA
2019-10-29Fix tests for CVE-2018-6914Nobuyoshi Nakada
Since the current working directory is not involved in `Tempfile` and `Dir.mktmpdir` (except for the last resort), it is incorrect to derive the traversal path from it. Also, since the rubyspec temporary directory is created under the build directory, this is not involved in the target method. Fixed sporadic errors in test-spec.
2019-10-29test/rubygems/test_gem.rb: early failure when there is /tmp/GemfileYusuke Endoh
Some test cases in rubygems assume that /tmp/Gemfile does not exist. If it does, they fail with very difficult-to-understand message: ``` [ 149/2108] TestGemBundlerVersionFinder#test_bundler_version_with_bundle_update_bundler = 0.00 1) Failure: TestGemBundlerVersionFinder#test_bundler_version_with_bundle_update_bundler [/home/mame/work/ruby/test/rubygems/test_gem_bundler_version_finder.rb:38]: Expected Gem::Version.new("2.0.2") to be nil. ``` I spent one hour to debug this issue. To prevent the same accident, this change makes the test suite stop when /tmp/Gemfile explicitly.
2019-10-29Revert "Revert "[ruby/rdoc] Use omit of test-unit instead of skip of minitest""Yusuke Endoh
This reverts commit ca5812fe4516a10cc687281f9e47e1a08449f1ab. Now tool/lib/minitest provides "omit", so it should work.
2019-10-29Revert "[ruby/rdoc] Use omit of test-unit instead of skip of minitest"Yusuke Endoh
This reverts commit b4da6fc1c277190bbd10e795ebf3be45772038e8. `make test-all` uses minitest, which led to "undefined method `omit'"
2019-10-29[ruby/rdoc] Use Dir.glob to convert short path of Dir.tmpdir to long pathaycabta
https://github.com/ruby/rdoc/commit/ba16e44572
2019-10-29[ruby/rdoc] Support different drive latters in include pathsaycabta
https://github.com/ruby/rdoc/commit/946d2592e2
2019-10-29[ruby/rdoc] Use omit of test-unit instead of skip of minitestaycabta
https://github.com/ruby/rdoc/commit/1c5bf2ae1d
2019-10-29Restore `in_kwarg` flag properlyNobuyoshi Nakada
2019-10-28fix bug in keyword + protected combination卜部昌平
Test included for the situation formerly was not working.
2019-10-26Make `(#methodname)` a linkNobuyoshi Nakada
2019-10-26Raise on end-exclusive ranges [Feature #14784]Nobuyoshi Nakada
Raises an error on end-exclusive ranges unless endless, regardless the receiver. Notes: Merged: https://github.com/ruby/ruby/pull/2613
2019-10-26[ruby/forwardable] Fix NoMethodError on ruby 2.4 or earlierKazuhiro NISHIYAMA
https://github.com/ruby/forwardable/runs/242918994#step:5:12 ``` Error: test_obj_single_delegators_send_id(TestForwardable): NoMethodError: private method `attr_reader' called for #<Class:#<Object:0x00005605af501f58>> ``` https://github.com/ruby/forwardable/commit/711bbb2466
2019-10-26[ruby/forwardable] Make def_{instance,single}_delegators skip :__send__ and ↵Jeremy Evans
:__id__ Previously, __send__ and __id__ were skipped if provided as strings, but not skipped if provided as symbols. Fixes Ruby Bug 8855. https://github.com/ruby/forwardable/commit/2e61c8c66c
2019-10-26[ruby/dbm] Remove taint supportJeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. https://github.com/ruby/dbm/commit/1f0ff0bce1
2019-10-25Fixed range argument condition [Feature #14784]Nobuyoshi Nakada
Allows a beginless/endless range, and an end-exclusive range unless the receiver is smaller than its end. Notes: Merged: https://github.com/ruby/ruby/pull/2611
2019-10-25skip tests that do not work on GC.stress卜部昌平
These tests rely on GC.stat and GC.last_gc_info, which are not stable when GC.stress is true. Skip them for that case.
2019-10-24Handle case where ruby2_keywords method splats to ruby2_keywords methodJeremy Evans
Previously, the keyword hash was duped (which results in a regular hash), but the dup was not marked as a keyword hash, causing the hash not to be marked as keyword hash even though it should be. Notes: Merged: https://github.com/ruby/ruby/pull/2609
2019-10-25retry tailcall optimization (#2529)wanabe
Sorry, f62f90367fc3bce6714e7c34cbd040e14e43fe07 is push miss.
2019-10-24Duplicate hash when converting keyword hash to keywordsJeremy Evans
This mirrors the behavior when manually splatting a hash. This mirrors the changes made in setup_parameters_complex in 6081ddd6e6f2297862b3c7e898d28a76b8f9240b, so that splatting to a non-iseq method works the same as splatting to an iseq method. Notes: Merged: https://github.com/ruby/ruby/pull/2606
2019-10-24Fix typo causing Date.new(year, month) to failJeremy Evans
Add a test for this case. Notes: Merged: https://github.com/ruby/ruby/pull/2605
2019-10-25Define arguments forwarding as `ruby2_keywords` styleNobuyoshi Nakada
Get rid of these redundant and useless warnings. ``` $ ruby -e 'def bar(a) a; end; def foo(...) bar(...) end; foo({})' -e:1: warning: The last argument is used as the keyword parameter -e:1: warning: for `foo' defined here -e:1: warning: The keyword argument is passed as the last hash parameter -e:1: warning: for `bar' defined here ```
2019-10-25Assert no-kwrest caseNobuyoshi Nakada