aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* numeric.c, range.c: prohibit zero stepKenta Murata2020-10-233-28/+19
| | | | | | | | | * numeric.c: prohibit zero step in Numeric#step * range.c: prohibit zero step in Range#step * Fix ruby-spec [Feature #15573]
* rational.c: try converting by to_int in Rational() (#3684)Kenta Murata2020-10-221-0/+19
| | | [Bug #12485]
* test/json/json_parser_test.rb: suppress warningsYusuke Endoh2020-10-211-2/+2
| | | | | | | | http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20201021T123003Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20201021T123003Z/ruby/test/json/json_parser_test.rb:227: warning: ambiguous first argument; put parentheses or a space even after `-' operator /home/chkbuild/chkbuild/tmp/build/20201021T123003Z/ruby/test/json/json_parser_test.rb:228: warning: ambiguous first argument; put parentheses or a space even after `-' operator ```
* Feature #16812: Allow slicing arrays with ArithmeticSequence (#3241)Kenta Murata2020-10-211-1/+37
| | | | | | | | | | | | | | | | | * Support ArithmeticSequence in Array#slice * Extract rb_range_component_beg_len * Use rb_range_values to check Range object * Fix ary_make_partial_step * Fix for negative step cases * range.c: Describe the role of err argument in rb_range_component_beg_len * Raise a RangeError when an arithmetic sequence refers the outside of an array [Feature #16812]
* strip trailing spaces [ci skip]Nobuyoshi Nakada2020-10-201-1/+1
|
* Fix an issue with generate_pretty and empty objects in the Ruby and Java ↵Chris Seaton2020-10-201-0/+5
| | | | implementations
* Implement a freeze: parser optionJean Boussier2020-10-201-0/+21
| | | | | | | If set to true all parsed objects will be immediately frozen, and strings will be deduplicated if the Ruby implementation allows it.
* range.c: Fix an exception message in rb_range_beg_lenKenta Murata2020-10-201-0/+3
| | | | [Bug #17271]
* Add a Ripper.lex test of :on_embexpr_endTakashi Kokubun2020-10-191-0/+7
| | | | | | | | | This is a weird use case of Ripper.lex which I'm not sure is supposed to be maintained, so I'm adding this test so that we can easily notice such changes. If we change the behavior, this will break the behavior of hamlit.gem v1 and code like https://github.com/haml/haml/pull/1043.
* Revert "test/rinda/test_rinda.rb: try debugging TestRingServer#test_do_reply"Yusuke Endoh2020-10-171-8/+1
| | | | | | This reverts commit de5e8d0e3bc3cc39487ffc9d9c15642b6881cd54. Remove the debugging code that is no longer needed
* Revert "test/rinda/test_rinda.rb: Add more debugging code"Yusuke Endoh2020-10-171-25/+0
| | | | | | This reverts commit ac803ab55db50ef891e3680680620d01f28a759b. Remove debugging code that is no longer needed
* test/rinda/test_rinda.rb: Prevent a callback Proc from being GC'edYusuke Endoh2020-10-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the log of ac803ab55db50ef891e3680680620d01f28a759b, I found that a thread terminates silently due to "recycled object" of id2ref: ``` "/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/lib/drb/drb.rb:366:in `_id2ref'" "/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/lib/drb/drb.rb:366:in `to_obj'" "/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/lib/drb/drb.rb:1528:in `to_obj'" "/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/lib/drb/drb.rb:1847:in `to_obj'" "/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/lib/drb/drb.rb:1136:in `method_missing'" "/home/chkbuild/chkbuild/tmp/build/20201017T033002Z/ruby/test/rinda/test_rinda.rb:652:in `block in do_reply'" ``` https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20201017T033002Z.log.html.gz I believe that this unintentional thread termination has caused intermittent timeout failure of `TestRingServer#test_do_reply`. The root cause of the "recycled object" issue is a bug of `TestRingServer#test_do_reply`. It creates a callback Proc object but does not hold the reference to the object: ``` callback = DRb::DRbObject.new callback ``` The original "callback" object is GC'ed unintentionally. I could consistently reproduce this issue on my machine by adding `GC.stress = true` at the first of `_test_do_reply` method body. This change uses another local variable name, "callback_orig", to keep the original Proc object.
* keep proc on the stack so it does not moveAaron Patterson2020-10-161-2/+6
|
* test/rinda/test_rinda.rb: Add more debugging codeYusuke Endoh2020-10-171-0/+25
| | | | in addition to de5e8d0e3bc3cc39487ffc9d9c15642b6881cd54
* test/rinda/test_rinda.rb: try debugging TestRingServer#test_do_replyYusuke Endoh2020-10-161-1/+8
| | | | | | | | | | | | | | | https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20201016T063003Z.fail.html.gz ``` 1) Error: Rinda::TestRingServer#test_do_reply: Timeout::Error: timeout /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:837:in `sleep' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:837:in `wait_for' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:659:in `_test_do_reply' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:643:in `block in test_do_reply' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:807:in `with_timeout' /home/chkbuild/chkbuild/tmp/build/20201016T063003Z/ruby/test/rinda/test_rinda.rb:643:in `test_do_reply' ```
* test/ruby/test_syntax.rb: avoid "warning: assigned but unused variable"Yusuke Endoh2020-10-161-1/+1
|
* Adjust sp for `if true or ...`/`if false and ...`wanabe2020-10-161-0/+5
|
* Adjust sp for `x = false; y = (return until x unless x)` [Bug #16695]wanabe2020-10-161-0/+9
|
* Check encoding name to replicateNobuyoshi Nakada2020-10-152-3/+9
| | | | https://hackerone.com/reports/954433
* Merge rubygems-3.2.0.rc.2Hiroshi SHIBATA2020-10-155-23/+18
|
* remove uneffective testKoichi Sasada2020-10-141-25/+0
| | | | | RubyVM.stat[:global_method_state] is no longer available so this test doesn't check any more.
* ruby_vm_global_method_state is no longer needed.Koichi Sasada2020-10-141-2/+2
| | | | Now ruby_vm_global_method_state is not used so let's remove it.
* test/ruby/test_fiber.rb: Suppress "assigned but unused variable" warningsYusuke Endoh2020-10-131-4/+2
|
* relax Fiber#transfer's restrictionKoichi Sasada2020-10-121-16/+87
| | | | | | | | | | | | | | | | | | | | | | | | | Using Fiber#transfer with Fiber#resume for a same Fiber is limited (once Fiber#transfer is called for a fiber, the fiber can not be resumed more). This restriction was introduced to protect the resume/yield chain, but we realized that it is too much to protect the chain. Instead of the current restriction, we introduce some other protections. (1) can not transfer to the resuming fiber. (2) can not transfer to the yielding fiber. (3) can not resume transferred fiber. (4) can not yield from not-resumed fiber. [Bug #17221] Also at the end of a transferred fiber, it had continued on root fiber. However, if the root fiber resumed a fiber (and that fiber can resumed another fiber), this behavior also breaks the resume/yield chain. So at the end of a transferred fiber, switch to the edge of resume chain from root fiber. For example, root fiber resumed f1 and f1 resumed f2, transferred to f3 and f3 terminated, then continue from the fiber f2 (it was continued from root fiber without this patch).
* Make the test suite pass on real Android/Termux environmentYusuke Endoh2020-10-123-4/+27
| | | | Attempting to create a hard link raises EACCES
* bignum.c (rb_int_powm): Integer#pow(0, 1) should return 0Yusuke Endoh2020-10-121-0/+20
| | | | ... instead of 1 because it requires "modulo 1". [Bug #17257]
* Prohibit setter method names in all kinds of endless methodsNobuyoshi Nakada2020-10-122-7/+50
| | | | Also unwrap NODE_RIPPER to check the method name.
* [ruby/io-console] Fix timeout type error (#18)Nobuyoshi Nakada2020-10-111-0/+4
| | | | | | | | | | | | | | | | | Fixed TypeError when IO#getch timed out `rb_io_wait` returns a bit-flags Integer representing available events, or Qfalse if timed out. Also the result of `NUM2INT` is not a `VALUE`. ``` $ ./bin/ruby -v -rio/console -e "p IO.console.getch(intr: true, time: 0.1)" ruby 3.0.0dev (2020-10-09T20:27:30Z master 5ea2ea74cc) [x64-mingw32] -e:1:in `getch': no implicit conversion of false into Integer (TypeError) from -e:1:in `<main>' ``` https://github.com/ruby/io-console/commit/3bdfaf62df
* [lib/ostruct] Fix Marshal loadingMarc-Andre Lafortune2020-10-061-0/+6
|
* Remove system method for E2E testing because depends on ruby commandaycabta2020-10-051-54/+75
|
* Show stdout and stderr when history tests failaycabta2020-10-051-32/+31
|
* Fix assert_ruby_status usage in 174ae0f5775cc7af7d197963a8f87b7d1972c268Kazuhiro NISHIYAMA2020-10-031-1/+1
|
* Remove known use-after-poison bugNobuyoshi Nakada2020-10-031-0/+4
| | | | | 9eda6547812cbda23a73ba3b2620520b0de2bdd6 was fixed by b9488accf9e2cbf5f7c47b42b3eb23469f0aa58d.
* Fix ObjectSpace.dump(obj, output: :stdout)Kazuhiro NISHIYAMA2020-10-031-7/+14
| | | | | | | RDoc says `ObjectSpace.dump(obj, output: :stdout) # => nil`, but it returns STDOUT since fbba6bd4e3dff7a61965208fecae908f10c4edbe. I think it is unintentional change.
* Ensure that the comparison succeeded [Bug #17205]Nobuyoshi Nakada2020-10-021-0/+21
|
* Refined assertions for better failure messagesNobuyoshi Nakada2020-10-011-4/+4
|
* strip trailing spaces [ci skip]Nobuyoshi Nakada2020-10-011-1/+1
|
* Remove `Thread.scheduler` from public interface.Samuel Williams2020-10-011-7/+6
| | | | | | It's implementation is equivalent to: Thread.current.scheduler unless Thread.current.blocking?
* Raise an exception if the scheduler was already closed.Samuel Williams2020-10-011-0/+2
|
* Don't call `Scheduler#close` if it doesn't exist.Samuel Williams2020-10-011-0/+8
|
* stop Ractor test in test-allKoichi Sasada2020-10-011-0/+3
| | | | | | | | Ractor changes the interpreter's running mode so now it should not use in test-all process which running with many other tests. Test with a separating process is one idea, but I'm not sure the ruby/ostruct can use this trick.
* [ruby/ostruct] Improved YAML serialization.Marc-Andre Lafortune2020-09-301-0/+21
| | | | Patch adapted from Pietro Monteiro [Fixes bug#8382]
* [ruby/ostruct] Add test that frozen OpenStructs are Ractor-shareableMarc-Andre Lafortune2020-09-301-0/+11
|
* [ruby/ostruct] Protect subclass' methods and our bang methods.Marc-Andre Lafortune2020-09-301-1/+23
| | | | Internally, use only bang methods
* [ruby/ostruct] Avoid calling initializeMarc-Andre Lafortune2020-09-301-0/+9
|
* Unfreeze string-literal-only interpolated string-literalNobuyoshi Nakada2020-09-301-1/+1
| | | | [Feature #17104]
* Remove unneeded `begin` and `end`Kazuhiro NISHIYAMA2020-09-301-6/+4
|
* Fix `Leaked tempfile`sKazuhiro NISHIYAMA2020-09-301-15/+3
| | | | | | | | | | | | | | | http://rubyci.s3.amazonaws.com/debian10/ruby-master/log/20200930T033004Z.diff.html.gz ``` [n/n] JSONCommonInterfaceTest#test_load = <elapsed> s [n/n] JSONCommonInterfaceTest#test_load_file = <elapsed> s +Leaked tempfile: JSONCommonInterfaceTest#test_load_file: #<Tempfile:<build-dir>/tmp/20200930-7601-ptnv6i (closed)> [n/n] JSONCommonInterfaceTest#test_load_file! = <elapsed> s +Leaked tempfile: JSONCommonInterfaceTest#test_load_file!: #<Tempfile:<build-dir>/tmp/20200930-7601-1la6m9 (closed)> [n/n] JSONCommonInterfaceTest#test_load_file_with_option = <elapsed> s +Leaked tempfile: JSONCommonInterfaceTest#test_load_file_with_option: #<Tempfile:<build-dir>/tmp/20200930-7601-blf9hz (closed)> [n/n] JSONCommonInterfaceTest#test_load_file_with_option! = <elapsed> s +Leaked tempfile: JSONCommonInterfaceTest#test_load_file_with_option!: #<Tempfile:<build-dir>/tmp/20200930-7601-b5gsdb (closed)> ```
* Fix order of operations during `rb_ec_finalize`.Samuel Williams2020-09-301-0/+14
|
* Fix unsigned int overflow in error message for chrPeter Zhu2020-09-301-0/+1
| | | | | | | | | | | | | | | | | | The error message has an integer overflow because it treats an unsigned int as a signed int. Before: ``` > 3_000_000_000.chr -1294967296 out of char range (RangeError) ``` After: ``` > 3_000_000_000.chr 3000000000 out of char range (RangeError) ``` Redmine ticket: https://bugs.ruby-lang.org/issues/17186