Commit graph

15017 commits

Author SHA1 Message Date
Yusuke Endoh
31794d2e73 parse.y: Allow "command" syntax in endless method definition
This change allows `def hello = puts "Hello"` without parentheses.

Note that `private def hello = puts "Hello"` does not parse for
technical reason.

[Feature #17398]
2021-05-13 00:14:50 +09:00
git
81513c9dab * remove trailing spaces. [ci skip] 2021-05-12 17:40:52 +09:00
Koichi Sasada
523a6998dd Use another class for the comparison.
`memsize_of(Object.new)` can be changed with past ivar creation
history for Object instances (another Object instance has 4 or
more ivars, next created Object instance has the area for the
ivars). So use antoher class for the comparison.
2021-05-12 17:40:31 +09:00
Hiroshi SHIBATA
81720b947a Use assert_raise instead of assert_raises 2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
cdcfe1082c Revert 924ce2c5ba4d1c1dc781a6a06682204d358421bb
Because test-unit didn't provide the benchmark test. And This test
  is fragile with the several environments.
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
bef49e6e8d [rubygems/rubygems] Added begin-end block for java platform
Because pend of test-unit raises exception.

b5e2d0855a
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
d33888bf96 [rubygems/rubygems] Replace skip to pend
0b145135c7
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
129bc04ab7 [rubygems/rubygems] util/rubocop -a
a10ff97830
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
00f5b4b546 [rubygems/rubygems] Don't use Minitest::Mock
d3fa893597
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
3456335a9c [rubygems/rubygems] Removed minitest/mock from test/rubygems/test_gem_remote_fetcher.rb
f1af59fe02
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
ff3f990499 [rubygems/rubygems] Removed minitest/mock from test_gem_package_tar_writer.rb
45464bfcbd
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
7b3b48549b [rubygems/rubygems] capture_output will return empty string, not nil
3fa93f6144
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
9b5e4ce611 [rubygems/rubygems] Fixed variable scope at test_silent_system
bfcdf79657
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
cd375e455e [rubygems/rubygems] Rewrite with capture_output
a091004ded
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
5ed9d3f16f [rubygems/rubygems] Use capture_output instead of capture_io
c46185abe3
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
c30594bb0c [rubygems/rubygems] Use assert_raise instead of assert_raises
769e87f011
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
2c0072dec5 [rubygems/rubygems] Use dummy assertion for assert_https
64d843fe17
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
a1c416460b [rubygems/rubygems] Use capture_output instead of assert_silent
3225aab7f8
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
958f9d425a [rubygems/rubygems] Use capture_output instead of capture_io for test-unit
ab9c80d4cb
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
3948be3503 [rubygems/rubygems] Use assert_path_exist and assert_path_not_exist instead of assert_path_exists and refute_path_exists
a7c93558c3
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
81d793a921 [rubygems/rubygems] Extract assert_output to assert_empty and assert_equal with capture_output
f6759440a4
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
183174475c [rubygems/rubygems] Use Regexp with refute_match
51fdbe53bc
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
3c9633acfc [rubygems/rubygems] Also use capture_output instead of capture_io
229858ea56
2021-05-12 17:24:43 +09:00
Hiroshi SHIBATA
26cbda8dc9 [rubygems/rubygems] Use capture_output instead of capture_io.
ad9206d4d0
2021-05-12 17:24:43 +09:00
Koichi Sasada
5a6af44e20 skip test for debug.
test_memsize_of_iseq fails on repeat tests and it seems to difficult
to solve immediately. Now this test is skipped.

It seems that the result of `memsize_of(Object.new)` are increased.
Why...?
2021-05-12 12:57:53 +09:00
Koichi Sasada
3df7c967bb suppress warnings on repeat tests.
Constant definitions are affect on outer namespace of an anonymous
module. To define constants on the anonymous module, this patch
uses Module#class_eval(str).
2021-05-12 12:53:14 +09:00
卜部昌平
6911b4bc82 test_cdhash: refactor change class
It is now strange to test Complex in a class named Rational_Test.
2021-05-12 10:30:46 +09:00
卜部昌平
cc0dc67bbb cdhash_cmp: can also take complex
There are complex literals `123i`, which can also be a case condition.
2021-05-12 10:30:46 +09:00
卜部昌平
d0e6c6e682 cdhash_cmp: rational literals with fractions
Nobu kindly pointed out that rational literals can have fractions.
2021-05-12 10:30:46 +09:00
卜部昌平
2bc293e899 cdhash_cmp: can take rational literals
Rational literals are those integers suffixed with `r`.  They tend to
be a part of more complex expressions like `123/456r`, but in theory
they can live alone.  When such "bare" rational literals are passed to
case-when branch, we have to take care of them.  Fixes [Bug #17854]
2021-05-12 10:30:46 +09:00
Takashi Kokubun
cc1ea6e023
Run nmake check on Actions (#4487)
* Run nmake check on Actions

* Skip tests not working in mswin GitHub Actions

* Override TEMP

* Revert "Skip tests not working in mswin GitHub Actions"

This reverts commit 544d2575fc.

* Revert "Revert "Skip tests not working in mswin GitHub Actions""

This reverts commit e1f8ad7862.

* Fix timeouts

* Skip some more broken tests

* Update windows.yml

* Add a guard for rbasic_spec

* Revert "Update windows.yml"

This reverts commit bc9694b6b3.

* Skip the ensure clause

* Simplify the ensure
2021-05-11 15:18:44 -07:00
Alan Wu
39a2ba5cc5
Method cache: fix refinement entry handling
To invalidate some callable method entries, we replace the entry in the
class. Most types of method entries are on the method table of the
origin class, but refinement entries without an orig_me are housed in
the method table of the class itself. They are there because refinements
take priority over prepended methods.

By unconditionally inserting a copy of the refinement entry into the
origin class, clearing the method cache created situations where there
are refinement entry duplicates in the lookup chain, leading to infinite
loops and other problems.

Update the replacement logic to use the right class that houses the
method entry. Also, be more selective about cache invalidation when
moving refinement entries for prepend. This avoids calling
clear_method_cache_by_id_in_class() before refinement entries are in the
place it expects.

[Bug #17806]
2021-05-11 12:05:06 -04:00
Yusuke Endoh
1b61cdd5e0 test/irb/test_raise_no_backtrace_exception.rb: Set LC_MESSAGES as UTF-8 2021-05-11 19:38:06 +09:00
Takashi Kokubun
66ca6ede16 [ruby/irb] Skip test_raise_exception_with_invalid_byte_sequence
on Windows for now. It seems like we haven't figured this out yet.

ecf5a1ace1
2021-05-11 14:46:33 +09:00
Takashi Kokubun
afa70d079f
Explicitly specify encoding for another test as well
Same as e2ccc3301e
39102539/job/k8m1yrrjesxbgvtq
2021-05-10 21:41:36 -07:00
Yusuke Endoh
e2ccc3301e test/irb/test_raise_no_backtrace_exception.rb: UTF-8 is expected
... for the output of assert_in_out_err.

This will fix the following failure on many CI machines

20210511T030005Z.fail.html.gz
```
  1) Failure:
TestIRB::TestRaiseNoBacktraceException#test_raise_exception_with_different_encoding_containing_invalid_byte_sequence [/home/chkbuild/chkbuild/tmp/build/20210511T030005Z/ruby/test/irb/test_raise_no_backtrace_exception.rb:41]:
pid 221531 exit 0.

1. [1/2] Assertion for "stdout"
   | invalid byte sequence in US-ASCII.
```
2021-05-11 13:30:28 +09:00
Takashi Kokubun
bb54361057 [ruby/irb] Skip the new IRB test on Windows for now
It's not passing from the beginning
2550929220
39100747

71fc180018
2021-05-11 13:01:38 +09:00
David Rodríguez
5b0abba931 Sync bundler & rubygems 2021-05-11 11:29:41 +09:00
aycabta
774cc32b4d [ruby/irb] Treat encodings in exception correctly
4452adbe04
2021-05-11 09:32:08 +09:00
Jean Boussier
c110ade0d2
[ruby/psych] Fix custom marshalization with symbolize_names: true
ee26f26ab5
2021-05-10 19:17:32 +09:00
Hiroshi SHIBATA
ab785b28e2 [ruby/psych] Use assert_raise instead of assert_raises
e6ad12b4e1
2021-05-10 19:09:43 +09:00
Hiroshi SHIBATA
bae9a21e40 [ruby/psych] Use pend instead of skip
efd2a62c9a
2021-05-10 18:53:56 +09:00
Hiroshi SHIBATA
53c5a4bbe1 [ruby/psych] Fixed test-case for NaN
f85a008263
2021-05-10 18:53:49 +09:00
Hiroshi SHIBATA
230d559f6b [ruby/psych] Use Ractor constant for ignoreing condition
cc5f957327
2021-05-10 18:53:41 +09:00
Hiroshi SHIBATA
ce67549c50 [ruby/psych] Use test-unit instead of minitest
01e7310dd3
2021-05-10 18:53:33 +09:00
Jeremy Evans
406ae7fb03 Fix Math.cbrt(0.0) on glibc
This should return 0, but on glibc it returned NaN.

Fixes [Bug #17804]
2021-05-08 14:45:30 -07:00
Nobuyoshi Nakada
c7601fb9ed [ruby/irb] Deal with different screen sizes
7118b3322f
2021-05-08 15:29:36 +09:00
Masataka Pocke Kuwabara
de96ae9b71 [ruby/irb] Dump ancestors' methods by ls command
73edff287c
2021-05-08 14:00:40 +09:00
Hiroshi SHIBATA
f2d6fa16e1 Use assert_ractor for separating test processes 2021-05-06 19:02:10 +09:00
Jeremy Evans
33b5e179a8 [ruby/timeout] Make Timeout::Error#exception with multiple arguments not ignore arguments
This makes:

  raise(Timeout::Error.new("hello"), "world")

raise a TimeoutError instance with "world" as the message instead
of "hello", for consistency with other Ruby exception classes.

This required some internal changes to keep the tests passing.

Fixes [Bug #17812]

952154dbf9
2021-05-06 16:49:26 +09:00