Граф коммитов

13139 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada f5abcf767e [ruby/rdoc] Removed `RDoc::Context::Section#sequence`
It has been deprecated since 2011.

https://github.com/ruby/rdoc/commit/5c2aa0f77d
2020-02-20 18:06:19 +09:00
卜部昌平 984e0233fe TestTime#test_memsize: skip when on GC_DEBUG
GC_DEBUG=1 makes this test fail because it changes the size of struct
RVALUE.  I don't think the test is useful then.  Let's just skip.
2020-02-20 11:46:54 +09:00
Takashi Kokubun c4794ed73a
Avoid jumping to a wrong destination
when the next insn is already compiled by former branches.
2020-02-18 23:19:06 -08:00
S-H-GAMELINKS 5fd5666dcc support multi-run test for test_readline.rb 2020-02-19 13:47:33 +09:00
Nobuyoshi Nakada 041c2932e3
Pass keyword arguments to IOs properly [Bug #16639] 2020-02-18 14:35:46 +09:00
Yusuke Endoh 2032432dad Partially revert "test/openssl/test_ssl.rb: skip OpenSSL::TestSSL#test_fallback_scsv"
A skip guard for test_fallback_scsv has been added in upstream
repository.
2020-02-17 20:53:19 +09:00
Kazuki Yamaguchi 8f91dc712a [ruby/openssl] test/openssl/test_ssl: skip test_fallback_scsv if necessary
Run the test case only when the OpenSSL supports both TLS 1.1 and TLS
1.2. Note that the fallback SCSV mechanism is for TLS 1.2 or older and
not for 1.3.

Fixes: https://github.com/ruby/openssl/issues/336

https://github.com/ruby/openssl/commit/6f2e6d7cf7
2020-02-17 20:51:27 +09:00
Kazuki Yamaguchi 99b191d83f [ruby/openssl] ts: simplify OpenSSL::Timestamp::Request#algorithm
Stop the special treatment of invalid hashAlgorithm of the message
imprint. Those invalid values can only appear after the object is
instantiated, before the user sets an actual message digest algorithm.

OpenSSL::Timestamp::TokenInfo#algorithm already does the same.

Also, remove the test case "test_create_request" since it does not make
much sense. Those fields are to be set by the user after creation of
the object and checking the initial value is pointless.

Fixes: https://github.com/ruby/openssl/issues/335

https://github.com/ruby/openssl/commit/890a6476fa
2020-02-17 20:50:47 +09:00
Yusuke Endoh 3fbcdac3e4 test/openssl/test_ssl.rb: skip OpenSSL::TestSSL#test_fallback_scsv
on OpenSSL 1.1.1d or later.

https://github.com/ruby/openssl/issues/336
2020-02-17 13:20:51 +09:00
Yusuke Endoh 331755c5e9 Revert "test/openssl/test_ts.rb: tentatively skip a failing test on CentOS 6.9"
This reverts commit a6d007c70b.

Unfortunately, the test fails on armv7l
https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20200216T091708Z.fail.html.gz
2020-02-16 22:16:22 +09:00
Yusuke Endoh a6d007c70b test/openssl/test_ts.rb: tentatively skip a failing test on CentOS 6.9
CentOS 6.9 will be EOL at Nov.  Ruby 3.0 (or 2.8) release version will
not support CentOS 6.9, so I'll remove the environment after it become
green.
2020-02-16 21:20:09 +09:00
Yusuke Endoh e37e0bfa98 test/openssl/test_ssl.rb: skip a test on OpenSSL 1.1.d or later
It fails due to "error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee
key too small".  This is a tentative measurement to avoid the failure.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-master/log/20200216T093010Z.fail.html.gz

test/openssl/fixture/chain/server.key should be longer.
It should be documented how to create the files.
BTW, it would be a good idea to dynamically create a key during test
instead of fixed files.
2020-02-16 20:48:40 +09:00
Yusuke Endoh 01138f5853 Make OpenSSL::OSSL#test_memcmp_timing robust
The test was too fragile.  Actually, it fails on one of our CIs
immediately after it was merged to ruby/ruby.

https://gist.github.com/ko1/7ea4a5826641f79e2f9e041d83e45dba#file-brlog-trunk_clang_40-20200216-101730-L532-L535
https://gist.github.com/ko1/1c657746092b871359d8bf9e0ad28921#file-brlog-trunk-test4-20200216-104518-L473-L476

* Two measurements, a-b and a-c, must be interative instead of
  sequential; the execution time will be easily affected by disturbance
  (say, cron job or some external process invoked during measurement)

* The comparison of the two results must be relative instead of
  absolute; slow machine may take several tens of seconds for each
  execution, and one delta second is too small.  The test cases of a, b,
  and c are very extreme, so if the target method has a bug, the two
  execution times would be very different.  So I think it is enough to
  check if the difference is less than 10 times.

This change is the same as https://github.com/ruby/openssl/pull/332
2020-02-16 19:55:19 +09:00
Hiroshi SHIBATA 3014574800
Guard for OpenSSL::PKey::EC::Group::Error with unsupported platforms 2020-02-16 16:08:43 +09:00
Hiroshi SHIBATA b99775b163
Import openssl-2.2.0 (#2693)
Import the master branch of ruby/openssl for preparing to release openssl-2.2.0
2020-02-16 15:21:29 +09:00
Nobuhiro IMAI 961630126b [ruby/irb] fix reserved words and completion for them
https://github.com/ruby/irb/commit/6184b227ad
2020-02-15 21:52:03 +09:00
Yusuke Endoh fb472ca7ad lib/drb/drb.rb: Use ruby2_keywords for keyword separation
[Bug #16634]
2020-02-15 16:27:03 +09:00
Yusuke Endoh fad98c6c61 test/irb/test_completion.rb: suppress a warning: unused literal ignored 2020-02-14 00:07:28 +09:00
Nobuyoshi Nakada fce667ed08
Get rid of warnings/exceptions at cleanup
After the encoding index instance variable is removed when all
instance variables are removed in `obj_free`, then `rb_str_free`
causes uninitialized instance variable warning and nil-to-integer
conversion exception.  Both cases result in object allocation
during GC, and crashes.
2020-02-13 12:46:48 +09:00
S-H-GAMELINKS b1b155ff03 support multi-run test for test/did_you_mean/test_verbose_formatter.rb 2020-02-13 11:07:38 +09:00
S-H-GAMELINKS 778c397310 Fix remove warning & support multi-run test for test/psych/visitors/test_to_ruby.rb 2020-02-13 11:01:15 +09:00
S-H-GAMELINKS 572d9b93bb support multi-run test for test/webrick/test_filehandler.rb 2020-02-13 10:37:40 +09:00
Yusuke Endoh 377c63366f test/rubygems/test_gem_commands_setup_command.rb: Allow /bin/env
Follow up of 65201c054a
2020-02-13 10:16:04 +09:00
Koichi Sasada 53a8b1486b skip SEGV test if RUBY_ON_BUG is specified 2020-02-13 04:20:22 +09:00
Koichi Sasada 99a8742067 should be compared with called_id
me->called_id and me->def->original_id can be different sometimes
so we should compare with called_id, which is mtbl's key.
(fix GH-PR #2869)
2020-02-13 03:30:22 +09:00
John Hawthorn ed7b46b66b Use inline cache for super calls 2020-02-13 00:14:55 +09:00
Nobuyoshi Nakada 160d3165eb
Copy non-inlined encoding index 2020-02-12 20:09:57 +09:00
Nobuyoshi Nakada bdf3032e35
Make temporary lock string encoding free
As a temporary lock string is hidden, it can not have instance
variables, including non-inlined encoding index.
2020-02-12 19:58:22 +09:00
aycabta 15cacf1f55 Add test_complete_symbol
The previous version of the test method used a symbol, ":abcdefg" to complete
but longer symbols that can be completed are defined by other test methods of
other libs.
2020-02-12 19:40:10 +09:00
Yusuke Endoh 65201c054a test/rubygems: Try not only /usr/bin/env but also /bin/env
RubyGems chooses available one from the two

20b0d60948/lib/rubygems/installer.rb (L38)

So, it is good not to hard-code /usr/bin/env in tests.
2020-02-12 17:33:41 +09:00
Yusuke Endoh 2090011dbd test/etc/test_etc.rb: skip some tests on Android
Android user management seems different from normal Unix system.
2020-02-12 17:28:29 +09:00
Nobuyoshi Nakada 52cdf400ef
Workaround of instance variable on hidden object
Since 9d9aea7fe5, generic instance
variables need `iv_index_tbl` in the object's class.  As hidden
objects, however, have no class, access to the variables causes a
segfault.  Get rid of that segfault by raising an exception, for
the time being.
2020-02-12 15:05:29 +09:00
Nobuyoshi Nakada 921916ff9e
Isolate the test for Encoding#replicate
It has global side effect which cannot be reverted.
2020-02-12 14:50:46 +09:00
Hiroshi SHIBATA 166c4a6a28
Revert "[ruby/irb] Add test_complete_symbol"
This reverts commit 3af3431c2c.
2020-02-12 14:38:40 +09:00
aycabta 8b8cc01229 [ruby/irb] Fix auto indent with closed brace
A closed brace in auto-indent shouldn't affect the next brace in the same line,
but it behaves like below:

  p() {
    }

It's a bug.

https://github.com/ruby/irb/commit/fbe59e344f
2020-02-12 13:14:28 +09:00
aycabta 0719e1be11 [ruby/irb] Check doc namespace correctly
IRB::InputCompletor::PerfectMatchedProc crashes when doc not found because a
variable name was incorrect.

https://github.com/ruby/irb/commit/889fd4928f
2020-02-12 13:14:28 +09:00
aycabta 3af3431c2c [ruby/irb] Add test_complete_symbol
https://github.com/ruby/irb/commit/dbbf086c1f
2020-02-12 13:14:28 +09:00
Jeremy Evans 7a288df7b8 Make yield in singleton class definitions in methods a SyntaxError
This behavior was deprecated in 2.7 and scheduled to be removed
in 3.0.

Calling yield in a class definition outside a method is now a
SyntaxError instead of a LocalJumpError, as well.
2020-02-11 12:44:23 -08:00
Nobuyoshi Nakada de3883e782
Restart timer thread even after preparation failed
If the timer thread is left stopped, memory crash or segfault can
happen.
2020-02-11 15:55:10 +09:00
Nobuyoshi Nakada 6e6844320d Fixed duplicated warning
As `command_rhs` is always a "value expression", `command_asgn`
does not need the same check.
2020-02-10 14:00:40 +09:00
Yusuke Endoh 6f04f0cc44 test/ruby/test_thread_queue.rb: add a wait to yield a thread
On Arch, sending a signal in a loop seems hardly to yield the execution.

```
  1) Error:
TestThreadQueue#test_queue_with_trap:
Timeout::Error: execution of assert_in_out_err expired timeout (10 sec)
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/arch/ruby-master/log/20200209T120002Z.fail.html.gz

This change allows the test to pass.
2020-02-09 21:40:53 +09:00
aycabta fd6746c7a6 [ruby/readline-ext] Use require check instead of DONT_RUN_RELINE_TEST env
https://github.com/ruby/readline-ext/commit/1df99d1481
2020-02-09 20:22:12 +09:00
aycabta ac0658e720 [ruby/readline-ext] Check TestRelineAsReadline existance
https://github.com/ruby/readline-ext/commit/c0a6303168
2020-02-09 20:22:12 +09:00
Nobuyoshi Nakada e3e96e3faa
Check if bindable against the refined target [Bug #16617] 2020-02-09 20:13:49 +09:00
Nobuyoshi Nakada 0f05b234fb
Disable GC until VM objects get initialized [Bug #16616] 2020-02-09 17:15:55 +09:00
S-H-GAMELINKS b76a21aa45 support multi-run test for test/did_you_mean/spell_checking/test_class_name_check.rb 2020-02-07 09:30:43 -05:00
S.H 59a40feec2
remove warning & support multi-run test for test/psych_test_yaml.rb (#2887) 2020-02-07 19:36:10 +09:00
S.H 38ed8cbb5f
remove warning & support multi-run test for test/psych/visitors/test_to_ruby.rb (#2881) 2020-02-07 19:35:52 +09:00
Nobuyoshi Nakada b64b0f3433
Show unmatched sequence on failure 2020-02-07 18:10:36 +09:00
Nobuyoshi Nakada 6ed1a5e0e6
Made a test more robust
Against changes of the `assert_separately` prologue code.
2020-02-07 13:52:53 +09:00
Nobuyoshi Nakada aece5baa75
Removed useless empty lines 2020-02-07 13:44:34 +09:00
Hiroshi SHIBATA 8c67080381
Revert "[rubygems/rubygems] Fix require issue with file extension priority"
This reverts commit d767da428c.

  It fails with spec/ruby/core/kernel/require_spec.rb:5
2020-02-06 22:07:39 +09:00
Hiroshi SHIBATA bd0a02d143
Revert to remove the query command of rubygems.
The original commit was https://github.com/rubygems/rubygems/pull/3119
2020-02-06 21:57:18 +09:00
David Rodríguez d767da428c
[rubygems/rubygems] Fix require issue with file extension priority
If `require "a"` is run when two folders have been specified in the -I
option including a "a.rb" file and a "a.so" file respectively, the ruby
spec says that the ".rb" file should always be preferred. However, the
logic we added in https://github.com/rubygems/rubygems/commit/6b81076d9
to make the -I option always beat default gems does not respect this
spec, creating a difference from the original ruby-core's require.

[the ruby spec says]: d80a6e2b22/core/kernel/shared/require.rb (L234-L246)

https://github.com/rubygems/rubygems/commit/b3944384f4
2020-02-06 21:57:18 +09:00
David Rodríguez c6b5881eae
[rubygems/rubygems] Make non "test_" method private
https://github.com/rubygems/rubygems/commit/912d141a35
2020-02-06 21:57:17 +09:00
Nobuyoshi Nakada 7d6903dc47
Add the loaded feature after no exception raised
Retrying after rescued `require` should try to load the same
library again.  [Bug #16607]
2020-02-04 16:10:39 +09:00
Nobuyoshi Nakada 9cdc964d07
Do not warn CR inside string literal 2020-02-04 14:41:52 +09:00
Lars Kanis 7a51d979cf
Fix inaccuracy in encoding tests
These tests assume
  Encoding.find('locale') == Encoding.find('external')
and fail if they are distinct.
2020-02-04 08:24:59 +09:00
Jean Boussier f2552216d4 Fix SimpleDelegator respond_to? regression
In 2.6, SimpleDelegator would always use the target `respond_to?`

In 2.7.0 it doesn't if the target does not inherit from Object.

This breaks compatibility for delegated objects that inherit
from BasicObject and redefine `respond_to?`.
2020-02-03 08:16:22 -08:00
Seiei Miyagi 11963da9e8 Check type of empty keyword [Bug #16603]
Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
2020-02-03 17:54:44 +09:00
Yusuke Endoh 0fa43b0c1b test/rubygems/test_gem_remote_fetcher.rb: Remove a duplicated test
https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu1604/ruby-master/log/20200203T003005Z.log.html.gz
```
/home/hsbt/chkbuild/tmp/build/20200203T003005Z/ruby/test/rubygems/test_gem_remote_fetcher.rb:485: warning: method redefined; discarding old test_fetch_path_socket_error
/home/hsbt/chkbuild/tmp/build/20200203T003005Z/ruby/test/rubygems/test_gem_remote_fetcher.rb:167: warning: previous definition of test_fetch_path_socket_error was here
```
2020-02-03 11:51:10 +09:00
Hiroshi SHIBATA 600a715c9b
Merge the current master branch of rubygems/rubygems.
Just started to develop RubyGems 3.2.0.
2020-02-01 11:14:57 +09:00
Nobuyoshi Nakada 9bcf4f3db2
delegate.rb: fixed keyword arguments in DelegateClass
`Delegator.delegating_block` should delegate keyword arguments
separately.  [ruby-core:96949]
2020-01-30 22:13:29 +09:00
Kazuhiro NISHIYAMA d142b37bdc
Add more debug print
https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20200129T022510Z.fail.html.gz
2020-01-29 15:00:03 +09:00
Koichi Sasada 7b4b01424f skip SEGV (BUG) tests if ENV['RUBY_ON_BUG'] is given.
This environment variable can show additional message on BUG.
2020-01-29 14:01:00 +09:00
Koichi Sasada 46173eeb64 support multi-run for test/ruby/enc/test_regex_casefold.rb
should not mutate test data.
2020-01-29 13:08:40 +09:00
Koichi Sasada 534536c7cc fix test cleanup.
should remove pathname.
2020-01-29 01:27:17 +09:00
Koichi Sasada 650f152d2f Revert "srand() should not run in tests."
This reverts commit 4d132fa130.

There are discussions about using srand() in tests.
I'll write a ticket about it and continue to discuss.
2020-01-29 00:56:51 +09:00
Koichi Sasada 0cfba9cdd9 Revert "remove debug code."
This reverts commit 65768c80be.
2020-01-29 00:55:11 +09:00
Koichi Sasada e7571f163b restore $LOADED_FEATURES.
Dir.tmpdir can return same directory because of rand() value,
so we shouldn't rely on different name.
2020-01-29 00:54:05 +09:00
Koichi Sasada 7882c43fc3 refactoring: use Proc and Constant. 2020-01-29 00:54:05 +09:00
Tanaka Akira 29e31e72fb ruby_reset_timezone resets leap_second_info.
[Bug #15177]
2020-01-29 00:01:57 +09:00
Koichi Sasada 65768c80be remove debug code. 2020-01-28 18:29:42 +09:00
Koichi Sasada 4d132fa130 srand() should not run in tests.
test_rand.rb calls srand() several times, however it change global
rand-sequence (and --seeds doesn't have meaning). This patch makes
such tests run in other processes.
2020-01-28 18:24:05 +09:00
Koichi Sasada 471a969311 use Minitest::Unit.current_repeat_count to skip multi-run. 2020-01-28 18:20:06 +09:00
Koichi Sasada dd64c34682 support multi-run for test/ruby/test_time.rb
ruby/test_time_tz.rb (not sure only this file affects) changes TZ
and it seems to change internal state. This internal state change
fails test_2038 and test_timegm on 2nd time execution.

At this time I have no idea how to fix this issue, so I skips these
tests on 2nd trial.

You can try this failure with the following command without this patch.

  $ make test-all TESTS='--repeat-count=2 ruby/require ruby/time ruby/time_tz'
2020-01-28 18:15:14 +09:00
Koichi Sasada 151533e4bc support multi-run for test/ruby/test_autoload.rb
Another test defines Object::A, but it will fail 2nd test.
2020-01-28 17:55:18 +09:00
Koichi Sasada 9552262bb2 support multi-run for test/ruby/test_struct.rb
Remove Structs to avoid redefinition warnings.
2020-01-28 15:23:52 +09:00
Koichi Sasada 4df0819c5d support multi-run for test/ruby/test_settracefunc.rb
need to remove Constants.
2020-01-28 15:23:51 +09:00
Koichi Sasada 0f03c1433e support multi-run for test/ruby/test_primitive.rb
need to redefine some classes.
2020-01-28 15:23:51 +09:00
Koichi Sasada 9b65bfdc9e support multi-run for test/ruby/test_refinement.rb
Give up to support multi-run:
* test_method_should_use_refinements
* test_instance_method_should_use_refinements

I hope someone can revisit it.
2020-01-28 15:23:51 +09:00
Koichi Sasada 56b0300f24 support multi-run for test/ruby/test_proc.rb
Mysterious error:
`remove_method(:foo) if method_defined?(:foo)` raise an exception
`method `foo' not defined in #<Class:#<TestProc:0x000055d12ff154e0>>`
This patch rename the method name foo to foo_arity to solve it.
2020-01-28 15:23:51 +09:00
Koichi Sasada 1bc731cb65 support multi-run for test/ruby/test_module.rb
add cleanup code in some tests.
2020-01-28 15:23:51 +09:00
Koichi Sasada cc2fe6936c support multi-run for test/ruby/test_method.rb
need to restore a method.
2020-01-28 15:23:51 +09:00
Koichi Sasada ac2b945bc0 support multi-run for test/ruby/test_marshal.rb
need to remove Constants.
2020-01-28 15:23:51 +09:00
Koichi Sasada 251930cea0 support multi-run for test/ruby/test_iseq.rb
need to remove a Constant.
2020-01-28 15:23:51 +09:00
Koichi Sasada 962c7abb13 support multi-run for test/ruby/test_eval.rb
need to remove a Constant.
2020-01-28 15:23:51 +09:00
Koichi Sasada 5f7be6243a support multi-run for test/ruby/test_encoding.rb
Unique encoding name is required.
2020-01-28 15:23:51 +09:00
Koichi Sasada 14759e6907 support multi-run for ruby/test_const.rb
need to redef Constants.
2020-01-28 15:23:51 +09:00
Koichi Sasada 501e7f4959 support multi-run for ruby/test_basicinstructions.rb
cvar should be initialized at first.
2020-01-28 15:23:51 +09:00
Koichi Sasada b17bab7472 support multi-run for ruby/test_autoload.rb
It requires more cleanup.
2020-01-28 15:23:51 +09:00
Koichi Sasada 8dbd5c76a0 support multiple run for test/ruby/test_array.
test-all supports multiple run with option --repeat-count=2
but test_equal_resize doesn't support it.
2020-01-28 15:23:51 +09:00
Nobuyoshi Nakada 1ddc719a56
Check the encoding of `half:` option 2020-01-27 16:12:15 +09:00
Nobuyoshi Nakada af899503a6
Moved `GC.verify_compaction_references` to gc.rb
And fixed a segfault by coercion of `Qundef`, when any keyword
argument without `toward:` option is given.
2020-01-27 10:52:37 +09:00
Kazuhiro NISHIYAMA 838fa941f1
Add more debug print
https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20200125T032406Z.fail.html.gz
```
IMAPTest#test_connection_closed_without_greeting [/export/home/rubyci/chkbuild-tmp/tmp/build/20200125T032406Z/ruby/test/net/imap/test_imap.rb:485]:
[Net::IMAP::Error] exception expected, not #<RuntimeError: {:"server before close"=>"#<TCPServer:fd 10, AF_INET6, ::1, 48515>", :sock_addr=>["AF_INET6", 48515, "::1", "::1"], :sock_peeraddr=>["AF_INET6", 35223, "::1", "::1"], :e=>#<Errno::EINVAL: Invalid argument - connect(2) for [::1]:48515>, :server=>#<TCPServer:(closed)>, :port=>48515, :server_addr=>"::1"}>.
```
2020-01-26 20:03:27 +09:00
aycabta 0aa5195262 Use test_mode on Reline::History::Test for encoding 2020-01-26 12:58:25 +09:00
Yusuke Endoh b4711a0fa0 test/rinda/test_rinda.rb: Increase the timeout
Attempts to fix a occational failure on Solaris with sunc

https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11-sunc/ruby-master/log/20200124T160008Z.fail.html.gz
```
  1) Error:
Rinda::TestRingServer#test_do_reply:
Timeout::Error: timeout
```
2020-01-25 14:14:05 +09:00
Nobuyoshi Nakada 0c436bbfbf
Recheck array length after `to_str` conversion
https://hackerone.com/reports/244787
2020-01-25 14:06:38 +09:00
Nobuyoshi Nakada 2b2821acd3
Recheck elements type after `to_str` conversion
https://hackerone.com/reports/244786
2020-01-25 13:57:33 +09:00
Jeremy Evans c1d8829ef5 Do not autosplat when calling proc with empty keyword splat
With the removal of the splatted argument when using an empty
keyword splat, the autosplat code considered an empty keyword
splat the same as no argument at all.  However, that results
in autosplat behavior changing dependent on the content of
the splatted hash, which is not what anyone would expect or
want.  This change always skips an autosplat if keywords were
provided.

Fixes [Bug #16560]
2020-01-24 13:04:14 -08:00
卜部昌平 a19228f878 brace the fact that lchmod(2) can EOPNOTSUPP
Musl libc has this function as a tiny wrapper of fchmodat(3posix).  On
the other hand Linux kernel does not support changing modes of a symlink.
The operation always fails with EOPNOTSUPP.  This fchmodat behaviour is
defined in POSIX.  We have to take care of such exceptions.
2020-01-24 10:49:35 +09:00
卜部昌平 50925b6409 reroute musl unistd.h weirdness
Musl is (of course) not glibc.  Its confstr(3) does not understand
_CS_GNU_LIBC_VERSION.  That's fair.  Problem is, its unistd.h has that
constant defined for unknown reason.  We cannot blindly say the libc is
glibc by looking at it.  Instead we have to kick it, then see if it
quacks like a duck.

See https://git.musl-libc.org/cgit/musl/tree/include/unistd.h
2020-01-24 10:49:35 +09:00
卜部昌平 3b9f36d6c6 pass appropriate libc path
The same as https://github.com/ruby/ruby/pull/2686, but for musl libc.
Musl is not named as libc.so.6 so the `ldd` hack implemented some lines
below does not work.
2020-01-24 10:49:35 +09:00
Jeremy Evans f8a8f05512 Remove empty keyword splats when calling even when using ruby2_keywords
Keeping empty keyword splats for ruby2_keywords methods was
necessary in 2.7 to prevent the final positional hash being
treated as keywords.  Now that keyword argument separation
has been committed, the final positional hash is never
treated as keywords, so there is no need to keep empty
keyword splats when using ruby2_keywords.
2020-01-23 09:30:29 -08:00
Benoit Daloze 0ea759eac9 Add more direct test for pp with a ruby2_keywords Hash 2020-01-23 10:59:26 +01:00
Yuta Iwama be6931f7f7 Add #verify_hostname= and #verify_hostname to skip hostname verification (#2858)
According to https://github.com/ruby/openssl/pull/60,

> Currently an user who wants to do the hostname verification needs to
call SSLSocket#post_connection_check explicitly after the TLS connection
is established.

if an user who wants to skip the hostname verification,
SSLSocket#post_connection_check doesn't need to be called

https://bugs.ruby-lang.org/issues/16555
2020-01-23 17:23:17 +09:00
aycabta 890200e85e Check DONT_RUN_RELINE_TEST envvar 2020-01-23 13:35:45 +09:00
aycabta 0d3e4b8a79 Use omit instead of skip 2020-01-23 13:31:19 +09:00
aycabta f09c1cf0e9 Skip a test that uses assert_ruby_status if it doesn't exist 2020-01-23 13:31:19 +09:00
aycabta a737f0cea5 Stop using minitest dependent methods 2020-01-23 13:31:19 +09:00
Jeremy Evans 28d31ead34 Fix pp when passed a empty ruby2_keywords-flagged hash as array element
This causes problems because the hash is passed to a block not
accepting keywords.  Because the hash is empty and keyword flagged,
it is removed before calling the block.  This doesn't cause an
ArgumentError because it is a block and not a lambda.  Just like
any other block not passed required arguments, arguments not
passed are set to nil.

Issues like this are a strong reason not to have ruby2_keywords
by default.

Fixes [Bug #16519]
2020-01-22 10:27:02 -08:00
Lars Kanis b0ca1fc21b Reline: Fix changed test results due to change to UTF-8 on Windows
In commit f8ea2860b0 the Reline encoding
for native windows console was changed to hardcoded UTF-8.
This caused failures in reline and readline tests, but they were hidden,
because parallel ruby tests incorrectly used Reline::ANSI as IOGate.
Tests failures were raised in single process mode, but not with -j switch.

This patch corrects encodings on native Windows console.
2020-01-21 21:26:58 +09:00
aycabta 2943ebd240 [ruby/reline] Implement vi_change_meta
https://github.com/ruby/reline/commit/8538e0e10f
2020-01-21 09:52:32 +09:00
Kenta Murata 51a8055d7d [ruby/irb] Add newline_before_multiline_output
https://github.com/ruby/irb/commit/9eb1801a66
2020-01-21 09:51:16 +09:00
aycabta 3b407abe9b [ruby/reline] Implement vi_prev_char and vi_to_prev_char
https://github.com/ruby/reline/commit/0ad3ee63fa
2020-01-20 19:13:19 +09:00
aycabta b17797a694 [ruby/reline] Implement vi_to_next_char
https://github.com/ruby/reline/commit/066ecb0a21
2020-01-20 19:13:19 +09:00
Nobuyoshi Nakada 2f1081a451
Sort globbed results by default [Feature #8709]
Sort the results which matched single wildcard or character set in
binary ascending order, unless `sort: false` is given.  The order
of an Array of pattern strings and braces are not affected.
2020-01-19 14:46:01 +09:00
Ryuta Kamizono af6563f024 Fix typo s/test_ruby2_keywords_hash!/test_ruby2_keywords_hash/
In #2818, `Hash.ruby2_keywords!` has renamed to `Hash.ruby2_keywords_hash`.
2020-01-19 13:06:27 +09:00
Nobuyoshi Nakada 979b32d76b
Removed useless sorts of lists generated from literals 2020-01-18 18:46:19 +09:00
Charles Oliver Nutter 569f56e0f7 [ruby/io-console] Filter Ruby engine name rather than just /ruby/
This breaks tests using this path on JRuby because the `jruby`
executable turns into `jjruby` after the sub.

https://github.com/ruby/io-console/commit/e5951aa34c
2020-01-18 00:15:00 +09:00
Yusuke Endoh 7cfe93c028 hash.c: Add a feature to manipulate ruby2_keywords flag
It was found that a feature to check and add ruby2_keywords flag to an
existing Hash is needed when arguments are serialized and deserialized.
It is possible to do the same without explicit APIs, but it would be
good to provide them as a core feature.

https://github.com/rails/rails/pull/38105#discussion_r361863767

Hash.ruby2_keywords_hash?(hash) checks if hash is flagged or not.
Hash.ruby2_keywords_hash(hash) returns a duplicated hash that has a
ruby2_keywords flag,

[Bug #16486]
2020-01-17 17:20:38 +09:00
Yusuke Endoh b23fd59cbb marshal.c: Support dump and load of a Hash with the ruby2_keywords flag
It is useful for a program that dumps and load arguments (like drb).
In future, they should deal with both positional arguments and keyword
ones explicitly, but until ruby2_keywords is deprecated, it is good to
support the flag in marshal.

The implementation is similar to String's encoding; it is dumped as a
hidden instance variable.

[Feature #16501]
2020-01-17 17:20:19 +09:00
Nobuyoshi Nakada c98c492578
Added test for f38b3e8c70 2020-01-17 16:56:53 +09:00
Kenta Murata 5275d8bf4c
rb_rational_raw: convert num and den by to_int 2020-01-17 10:57:51 +09:00
Kenta Murata 47465ab1cc
rb_rational_raw: make a denominator always positive 2020-01-17 10:57:21 +09:00
aycabta 800c2a8e4c Implement vi_insert_at_bol and vi_add_at_eol 2020-01-17 01:37:01 +09:00
aycabta ec0b366a5c Add tests for vi_insert and vi_add 2020-01-17 01:37:01 +09:00
Nobuyoshi Nakada c171ab23e3
Separate numbered parameter scope in eval
[Feature #16432]
2020-01-16 18:38:48 +09:00
Nobuyoshi Nakada f38b3e8c70
Fixed the location of args node with numbered parameter 2020-01-16 18:34:31 +09:00
Nobuyoshi Nakada fce54a5404
Fix `String#partition`
Split with the matched part when the separator matches the empty
part at the beginning.  [Bug #11014]
2020-01-16 15:36:38 +09:00
Nobuyoshi Nakada 4f19666e8b
`Regexp` in `MatchData` can be `nil`
`String#sub` with a string pattern defers creating a `Regexp`
until `MatchData#regexp` creates a `Regexp` from the matched
string.  `Regexp#last_match(group_name)` accessed its content
without creating the `Regexp` though.  [Bug #16508]
2020-01-16 11:32:11 +09:00
Jean Boussier 98ef38ada4 Freeze Regexp literals
[Feature #8948] [Feature #16377]

Since Regexp literals always reference the same instance,
allowing to mutate them can lead to state leak.
2020-01-15 10:38:47 +09:00
aycabta f8ea2860b0 Introduce an abstracted structure about the encoding of Reline
The command prompt on Windows always uses Unicode to take input and print
output but most Reline implementation depends on Encoding.default_external.
This commit introduces an abstracted structure about the encoding of Reline.
2020-01-14 15:40:38 +09:00
Ben c94025b630 [ruby/irb] Fix crashing when multiple open braces per line
https://github.com/ruby/irb/issues/55

If we had put multiple open braces on a line the with no closing brace
spaces_of_nest array keeps getting '0' added to it. This means that when
we pop off of this array we are saying that we should be in position zero
for the next line. This is an issue because we don't always want to be
in position 0 after a closing brace.

Example:
```
[[[
]
]
]
```
In the above example the 'spaces_of_nest' array looks like this after
the first line is entered: [0,0,0]. We really want to be indented 4
spaces for the 1st closing brace 2 for the 2nd and 0 for the 3rd. i.e.
we want it to be: [0,2,4].

We also saw this issue with a heredoc inside of an array.

```
[<<FOO]
hello
FOO
```

https://github.com/ruby/irb/commit/80c69c8272
2020-01-14 15:40:38 +09:00
Ben 9994eb8a5e [ruby/irb] Fix newline depth with multiple braces
This commit fixes the check_newline_depth_difference method to multiple
open braces on one line into account. Before this change we were
subtracting from the depth in check_newline_depth_difference on
every open brace. This is the right thing to do if the opening and
closing brace are on the same line. For example in a method definition we
have an opening and closing parentheses we want to add 1 to our depth,
and then remove it.

```
def foo()
end
```

However this isn't the correct behavior when the brace spans multiple
lines. If a brace spans multiple lines we don't want to subtract from
check_newline_depth_difference and we want to treat the braces the same
way as we do `end` and allow check_corresponding_token_depth to pop the
correct depth.

Example of bad behavior:

```
def foo()
  [
  ]
puts 'bar'
end
```

Example of desired behavior:

```
def foo()
  [
  ]
  puts 'bar'
end
```

https://github.com/ruby/irb/commit/7dc8af01e0
2020-01-14 15:40:38 +09:00
John Hawthorn 91601dcc6a Simplify obj2ubits checks
If this value is less than zero, then the mask check is guaranteed to
fail as well, so we might as well rely on that.
2020-01-13 13:58:23 -08:00
Hiroshi SHIBATA 83240f315a Make rss library to the bundle gems
[Feature #16485][ruby-core:96683]
2020-01-12 12:28:29 +09:00
Hiroshi SHIBATA c3ccf23d58 Make rexml library to the bundle gems
[Feature #16485][ruby-core:96683]
2020-01-12 12:28:29 +09:00
Nobuyoshi Nakada eb737916b1
Warn when :newline precedes other newline options 2020-01-11 10:42:22 +09:00
Nobuyoshi Nakada 8bb24712de
Added assertions for newline decorators 2020-01-11 10:42:21 +09:00
Nobuyoshi Nakada 1b4d406e3a
Hash#transform_values should return a plain new Hash
[Bug #16498]
2020-01-10 21:44:38 +09:00
Nobuyoshi Nakada b369f5e8a2
Fixed up 0eeed5bcc5
`Binding#source_location` returns the `__FILE__` when created, and
may not be an absolute or real path.  And in the `eval` context
with an explicit file name, `__dir__` also returns that name.
On the other hand, `__FILE__` in `require`d script file has been
expanded at searching the library.
2020-01-09 10:13:08 +09:00
Kazuhiro NISHIYAMA beb59c3b45
Add GC guard
Try to fix infrequent error:

https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris10-sunc/ruby-master/log/20200108T010004Z.fail.html.gz
```
  1) Error:
DRbTests::TestDRbSSLCore#test_02_basic_object:
RangeError: "348" is recycled object
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:366:in `_id2ref'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:366:in `to_obj'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1537:in `to_obj'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1856:in `to_obj'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:620:in `recv_request'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:931:in `recv_request'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1665:in `init_with_client'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1677:in `setup_message'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1641:in `perform'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1734:in `block (2 levels) in main_loop'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1730:in `loop'
    (drbssl://localhost:58371) /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/lib/drb/drb.rb:1730:in `block in main_loop'
    /export/home/users/chkbuild/cb-sunc/tmp/build/20200108T010004Z/ruby/test/drb/drbtest.rb:163:in `test_02_basic_object'
```
2020-01-08 12:26:48 +09:00
Yusuke Endoh e92bebb0c5 Suppress some warnings
```
.../ruby/test/ruby/test_keyword.rb:3509: warning: assigned but unused variable - bug8993
.../ruby/test/ruby/test_object.rb:83: warning: assigned but unused variable - f
.../ruby/test/ruby/test_object.rb:95: warning: method redefined; discarding old initialize_clone
.../ruby/test/ruby/test_object.rb:84: warning: previous definition of initialize_clone was here
```
2020-01-07 01:33:30 +09:00
aycabta 7392083c2f Support history-size in .inputrc correctly 2020-01-06 21:50:48 +09:00
Koichi Sasada ce072fe568 script_compiled event on compile error.
script_compiled event for TracePoint should not be invoked on
compile error (SyntaxError) because it is not "compiled".
[Bug #16459]
2020-01-06 11:36:51 +09:00
aycabta 439e1ccd08 Complete indented and quoted string correctly
def foo
    ''.upca[TAB]

This will be completed to be:

  def foo
  ''.upcase

The indent was gone. This commit fixes the bug.
2020-01-06 01:20:24 +09:00
Jeremy Evans 04eb7c7e46 Call initialize_clone with freeze: false if clone called with freeze: false
This makes it possible to initialize_clone to correctly not freeze
internal state if the freeze: false keyword is passed to clone.

If clone is called with freeze: true or no keyword, do not pass
a second argument to initialize_clone to keep backwards
compatibility.

This makes it so that external libraries that override
initialize_clone but do not support the freeze keyword will fail
with ArgumentError if passing freeze: false to clone.  I think that
is better than the current behavior, which succeeds but results in
an unfrozen object with frozen internals.

Fix related issues in set and delegate in stdlib.

Fixes [Bug #14266]
2020-01-03 20:13:09 -08:00
Jeremy Evans 0eeed5bcc5 Make eval(code, binding) use (eval) as __FILE__ and 1 as __LINE__
This removes the warning that was added in
3802fb92ff, and switches the behavior
so that the eval does not use the binding's __FILE__ and __LINE__
implicitly.

Fixes [Bug #4352]
2020-01-03 20:13:09 -08:00
Jeremy Evans ff96565686 Update tests for full keyword argument separation 2020-01-02 18:40:45 -08:00
Jeremy Evans beae6cbf0f Fully separate positional arguments and keyword arguments
This removes the warnings added in 2.7, and changes the behavior
so that a final positional hash is not treated as keywords or
vice-versa.

To handle the arg_setup_block splat case correctly with keyword
arguments, we need to check if we are taking a keyword hash.
That case didn't have a test, but it affects real-world code,
so add a test for it.

This removes rb_empty_keyword_given_p() and related code, as
that is not needed in Ruby 3.  The empty keyword case is the
same as the no keyword case in Ruby 3.

This changes rb_scan_args to implement keyword argument
separation for C functions when the : character is used.
For backwards compatibility, it returns a duped hash.
This is a bad idea for performance, but not duping the hash
breaks at least Enumerator::ArithmeticSequence#inspect.

Instead of having RB_PASS_CALLED_KEYWORDS be a number,
simplify the code by just making it be rb_keyword_given_p().
2020-01-02 18:40:45 -08:00
Nobuyoshi Nakada 34bc15c86b
Check Module#ruby2_keywords arity
It is considered a mistake, because calling this method with no
arguments has no effect.
2020-01-02 10:41:24 +09:00
aycabta 049292e302 Add load path and require for ruby/ruby 2020-01-01 02:04:41 +09:00
aycabta 66e6055c11 [ruby/irb] Fix lib name of OpenStruct
https://github.com/ruby/irb/commit/1f3a84ab6b
2020-01-01 01:38:37 +09:00
aycabta 9deb942715 Add "require 'openstruct'" what is forgotten 2019-12-31 23:32:24 +09:00
Ben a118bb805f [ruby/irb] Add tests for RubyLex
The set_auto_indent method calculates the correct number of spaces for
indenting a line. We think there might be a few bugs in this method so
we are testing the current functionality to make sure nothing breaks
when we address those bugs.

Example test failure:

```
  1) Failure:
TestIRB::TestRubyLex#test_auto_indent [/Users/Ben/Projects/irb/test/irb/test_ruby_lex.rb:75]:
Calculated the wrong number of spaces for:
 def each_top_level_statement
  initialize_input
  catch(:TERM_INPUT) do
    loop do
      begin
        prompt
        unless l = lex
          throw :TERM_INPUT if @line == ''
        else
.
<10> expected but was
<12>.
```

https://github.com/ruby/irb/commit/752d5597ab
2019-12-31 23:32:24 +09:00
Nobuyoshi Nakada 0cf75e3850 Split test_nomethod_error.rb 2019-12-31 19:43:36 +09:00
Nobuyoshi Nakada a580a3757b Split test_name_error.rb 2019-12-31 19:43:36 +09:00
Nobuyoshi Nakada ee4ead8098 Split test_frozen_error.rb 2019-12-31 19:43:36 +09:00
Nobuyoshi Nakada 8caeef7c1d Fix the exception to be raised
`NoMethodError` has been raised instead of `FrozenError`.
2019-12-31 19:43:36 +09:00
MSP-Greg d912393e09 text/readline/test_readline.rb - fix skip on Reline (#2743)
TestRelineAsReadline#test_input_metachar passes on MinGW
2019-12-31 00:29:58 -08:00
MSP-Greg eb2b425821 MinGW on Actions (#2791)
* MinGW - skip spec in spec/ruby/optional/capi/thread_spec.rb

C-API Thread function rb_thread_call_without_gvl
      -- runs a C function with the global lock unlocked and unlocks IO with the generic RUBY_UBF_IO

stops/freezes spec tests

See https://bugs.ruby-lang.org/issues/16265

* MinGW - skip test test/resolv/test_dns.rb

Test times out in CI (both AppVeyor & Actions), cannot repo locally

* MinGW - skip test test/ruby/test_thread_queue.rb

* Add Actions mingw.yml
2019-12-30 23:19:31 -08:00
Alan Wu 99c7b0b7ea
Decide lambdaness of (f << g) using g (#2729)
* Deciding lambdaness of (f << g) using g

* Use version guards for spec changes
2019-12-30 17:47:58 -05:00
Nobuyoshi Nakada 31e2f03512 [ruby/io-console] Enable only interrupt bits on `intr: true`
https://github.com/ruby/io-console/commit/baaf929041
2019-12-29 16:26:22 +09:00
aycabta 4db898284d Add test_completion_with_indent_and_completer_quote_characters
This is for 8a705245e5.
2019-12-27 16:07:52 +09:00
Nobuyoshi Nakada b25e27277d
Transform hash keys by a hash [Feature #16274] 2019-12-26 15:50:34 +09:00
Yusuke Endoh 81e377023c range.c: Range#min with a beginless one now raise an explicit exception
[Bug #16450]
2019-12-25 13:36:23 +09:00
aycabta 622e47a1db ^D on non-empty line in vi mode behaves like Enter 2019-12-25 09:34:13 +09:00
Nobuyoshi Nakada a3c5dbf291
Scale sleeping times to wait for the OS operations 2019-12-24 18:53:14 +09:00
aycabta 42e2a322f1 The delete-char-or-list shows completed list when called at end of line
It doesn't behave the same as the delete-char.
2019-12-24 18:34:43 +09:00
Nobuyoshi Nakada 81504e83e7
Synchronize with a Queue instead of sleeping 2019-12-24 15:48:08 +09:00
Koichi Sasada 47ad57f245 Revert "Scale sleeping times"
This reverts commit e57d619421.

Test fails:
http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sky1/2518563
http://ci.rvm.jp/results/trunk-gc_compact@silicon-docker/2518533
2019-12-24 15:38:46 +09:00
Nobuyoshi Nakada e57d619421
Scale sleeping times 2019-12-24 14:56:17 +09:00
Nobuyoshi Nakada e954be14d0
Get rid of false positive misspellings
[Bug #16437]
2019-12-24 10:33:32 +09:00
aycabta adc9b3ca7f [ruby/rdoc] Support newline in the middle of constant definition
https://github.com/ruby/rdoc/commit/74d3984324
2019-12-24 07:58:53 +09:00
aycabta e50e552693 [ruby/rdoc] Treat Proc#call syntax sugar for constant correctly
https://github.com/ruby/rdoc/commit/957d041ae0
2019-12-24 07:58:53 +09:00
Marc-Andre Lafortune 819b604037 Reword keyword arguments warning messages to convey these are deprecation warnings 2019-12-23 16:47:33 -05:00
Koichi Sasada a96f8cecc2 ObjectSpace._id2ref should check liveness.
objspace->id_to_obj_tbl can contain died objects because of lazy
sweep, so that it should check liveness.
2019-12-23 15:04:56 +09:00
Yuki Nishijima 672a61b97f Port dd1dd86e6c 2019-12-23 00:47:41 -05:00
NAKAMURA Usaku 204dc3f39f Revert "Should return "." for File.extname("file.") also on Windows"
We want to introduce consistency and better compatibility with unixen,
but the Windows APIs doues not have consistency fundamentally and
we can not found any logical way...

This reverts commit 61aff0cd18.
2019-12-23 11:54:25 +09:00
Koichi Sasada cf59e1476d fix a thread test.
* Use Queue for synchronization.
* Don't use `sleep 0.2` and use `th.join` because created thread
  can raise an exception after 0.2 seconds.
2019-12-22 06:29:52 +09:00
Yusuke Endoh 75acbd5f00 compile.c: avoid newarraykwsplat for arguments
`foo(*rest, post, **empty_kw)` is compiled like
`foo(*rest + [post, **empty_kw])`, and `**empty_kw` is removed by
"newarraykwsplat" instruction.
However, the method call still has a flag of KW_SPLAT, so "post" is
considered as a keyword hash, which caused a segfault.
Note that the flag cannot be removed if "empty_kw" is not always empty.

This change fixes the issue by compiling arguments with "newarray"
instead of "newarraykwsplat".

[Bug #16442]
2019-12-22 03:35:29 +09:00
NAKAMURA Usaku 61aff0cd18 Should return "." for File.extname("file.") also on Windows
But not changes another cases, such as "file.rb."
[Bug #15267]
2019-12-22 02:42:09 +09:00
Alan Wu 85a337f986 Kernel#lambda: return forwarded block as non-lambda proc
Before this commit, Kernel#lambda can't tell the difference between a
directly passed literal block and one passed with an ampersand.

A block passed with an ampersand is semantically speaking already a
non-lambda proc. When Kernel#lambda receives a non-lambda proc, it
should simply return it.

Implementation wise, when the VM calls a method with a literal block, it
places the code for the block on the calling control frame and passes a
pointer (block handler) to the callee. Before this commit, the VM
forwards block arguments by simply forwarding the block handler, which
leaves the slot for block code unused when a control frame forwards its
block argument. I use the vacant space to indicate that a frame has
forwarded its block argument and inspect that in Kernel#lambda to detect
forwarded blocks.

This is a very ad-hoc solution and relies *heavily* on the way block
passing works in the VM. However, it's the most self-contained solution
I have.

[Bug #15620]
2019-12-21 09:08:52 -05:00
Yusuke Endoh ea405ee8ed test/ruby/test_pattern_matching.rb: suppress "unused variable" warning 2019-12-21 10:06:14 +09:00
Nobuyoshi Nakada 484c1be895
Added `-W:experimental` command line option
[Feature #16420]
2019-12-20 23:51:17 +09:00
Nobuyoshi Nakada 07e595fdbd
Added `experimental` warning category
[Feature #16420]
2019-12-20 23:48:15 +09:00
Nobuyoshi Nakada a84ad24386
Added -W: command line option
To manage `Warning[category]` flags.  Only `-W:deprecated` and
`-W:no-deprecated` are available now.  [Feature #16345]
2019-12-20 23:05:22 +09:00
Yusuke Endoh f7aee58498 vm_args.c: rephrase the warning message of keyword argument separation
(old)
test.rb:4: warning: The last argument is used as the keyword parameter
test.rb:1: warning: for `foo' defined here; maybe ** should be added to the call?

(new)
test.rb:4: warning: The last argument is used as keyword parameters; maybe ** should be added to the call
test.rb:1: warning: The called method `foo' is defined here
2019-12-20 19:41:15 +09:00
Nobuyoshi Nakada 2b2030f265
Refined the warning message for $, and $;
[Bug #16438]
2019-12-20 15:09:23 +09:00
Nobuyoshi Nakada 7a94225e7d
Refined the warning message for numbered-parameter like variables
[Bug #16438]
2019-12-20 14:58:51 +09:00
Nobuyoshi Nakada a8bddb3a18
Refined the warning message for numbered-parameter like variables
[Bug #16438]
2019-12-20 14:34:32 +09:00
Nobuyoshi Nakada 435a4ca2a3
Makes the receiver to FrozenError.new a keyword parameter
[Feature #16419]
2019-12-20 14:18:20 +09:00
Nobuyoshi Nakada e68999c82c
Fixed misspellings
Fixed misspellings reported at [Bug #16437], for default gems.
2019-12-20 12:19:45 +09:00
Hiroshi SHIBATA e672494cd7
Merge RubyGems 3.1.2 2019-12-20 11:50:32 +09:00
Nobuyoshi Nakada db16629008
Fixed misspellings
Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
2019-12-20 09:32:42 +09:00
Nobuyoshi Nakada 2898367b3a
Warn also numbered parameter like methods 2019-12-20 08:18:19 +09:00
Nobuyoshi Nakada 27ddb6e998
Warn also numbered parameter like parameters
[Feature #16433]
2019-12-20 01:25:34 +09:00
Nobuyoshi Nakada 7aa8a78674
Manage deprecation warnings about keyword argument 2019-12-19 09:52:17 +09:00
Nobuyoshi Nakada 9bf9de3d9d
Made the warning for deprecated constants follow the category flag 2019-12-19 09:52:16 +09:00