summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
2019-11-18Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans
This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby. Notes: Merged: https://github.com/ruby/ruby/pull/2476
2019-11-18Warn on access/modify of $SAFE, and remove effects of modifying $SAFEJeremy Evans
This removes the security features added by $SAFE = 1, and warns for access or modification of $SAFE from Ruby-level, as well as warning when calling all public C functions related to $SAFE. This modifies some internal functions that took a safe level argument to no longer take the argument. rb_require_safe now warns, rb_require_string has been added as a version that takes a VALUE and does not warn. One public C function that still takes a safe level argument and that this doesn't warn for is rb_eval_cmd. We may want to consider adding an alternative method that does not take a safe level argument, and warn for rb_eval_cmd. Notes: Merged: https://github.com/ruby/ruby/pull/2476
2019-11-14`#@1` is no longer an embedded variableNobuyoshi Nakada
2019-11-14test/ruby/test_proc.rb: suppress "method redefined" warningsYusuke Endoh
2019-11-13Suspend many fibers test on JIT for nowTakashi Kokubun
https://github.com/ruby/ruby/runs/301411717 No C backtrace information and this is hard to fix immediately. As CI doesn't provide helpful information, this should be debugged locally or at least have more logs there.
2019-11-12Skip tailcall test for MJITTakashi Kokubun
failing in https://github.com/ruby/ruby/runs/300579218
2019-11-13Avoid top-level search for nested constant reference from nil in defined?Dylan Thacker-Smith
Fixes [Bug #16332] Constant access was changed to no longer allow top-level constant access through `nil`, but `defined?` wasn't changed at the same time to stay consistent. Use a separate defined type to distinguish between a constant referenced from the current lexical scope and one referenced from another namespace. Notes: Merged: https://github.com/ruby/ruby/pull/2657
2019-11-12Show the name `Kernel#proc` in the warning messageNobuyoshi Nakada
2019-11-12Added assertions for realpath and realdirpathNobuyoshi Nakada
It is said that realpath(3) and realdirpath(3) on some platforms may return a relative path.
2019-11-12Revert "Method reference operator"Nobuyoshi Nakada
This reverts commit 67c574736912003c377218153f9d3b9c0c96a17b. [Feature #16275]
2019-11-12Warn on `...` at EOLNobuyoshi Nakada
2019-11-12Clear current argument name at empty block argument [Bug #16343]Nobuyoshi Nakada
2019-11-12test/ruby/test_require.rb: Remove the tests of require with $SAFEYusuke Endoh
The taint mechanism is decided to be removed at 2.7. [Feature #16131] So, this change removes the tests that expects a SecurityError when requiring a file under $SAFE >= 1. The reason why they should be removed in advance is because the upstream of rubygems has already removed a call to "untaint" method, which makes the tests fail.
2019-11-11Skip test_validate_gemspec unless git installedKazuhiro NISHIYAMA
2019-11-11Revert "Warn EOF char in comment"NARUSE, Yui
This reverts commit 69ec3f70fab0c1c537c68fb135cc315181b1d750.
2019-11-11Revert "Elaborated EOF char message a little"NARUSE, Yui
This reverts commit 6eaac7cfac668d6669be694fd7b723c4982ed218.
2019-11-11Elaborated EOF char message a littleNobuyoshi Nakada
2019-11-11Warn EOF char in commentNobuyoshi Nakada
2019-11-11Fixed embedded document with EOF charNobuyoshi Nakada
2019-11-11Prefer assert_syntax_error and assert_valid_syntaxNobuyoshi Nakada
2019-11-10Fix uplevel of test_jitTakashi Kokubun
2019-11-10Disallow omission of parentheses/brackets in single line pattern matching ↵Kazuki Tsujimoto
[Feature #16182]
2019-11-09Test opt_invokebuiltin_delegate_leave in test_jitTakashi Kokubun
2019-11-09Support RB_BUILTIN in ISeq#to_aTakashi Kokubun
2019-11-09Test invokebuiltin in test_jitTakashi Kokubun
ISeq#to_a is commented out because it's broken now
2019-11-09Extend sleep duration for SolarisTakashi Kokubun
2019-11-08Fix passing actual object_id to finalizerJohn Hawthorn
Previously we were passing the memory_id. This was broken previously if compaction was run (which changes the memory_id) and now that object_id is a monotonically increasing number it was always broken. This commit fixes this by defering removal from the object_id table until finalizers have run (for objects with finalizers) and also copying the SEEN_OBJ_ID flag onto the zombie objects. Notes: Merged: https://github.com/ruby/ruby/pull/2658
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-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-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-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-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-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