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

12912 Коммитов

Автор SHA1 Сообщение Дата
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