summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-11-04openssl: pull test case from upstream commit 62af0446569arhe
The test case added by r60310 ("fix OpenSSL::SSL::SSLContext#min_version doesn't work", 2017-10-21) does not pass with OpenSSL >= 1.1.0 or LibreSSL >= 2.6.0. Check that the default 'min_version' value is properly enforced by actually attempting a handshake rather than by inspecting the SSL option flags. [ruby-core:83479] [Bug #14039] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-03test/ruby/test_eval.rb: use orphan procsnobu
This failure has been hidden by the bug of assert_raise which is fixed at r60614. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-02skip/fix wrong testsnobu
* test/ruby/test_{class,eval}.rb: skip or fix wrong tests hidden by a bug of assert_raise. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-02assertions.rb: fix return in assert_raisenobu
* test/lib/test/unit/assertions.rb (assert_raise): should fail if returned gently in the given block without any exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-02compile.c: kw splat after splatnobu
* compile.c (setup_args): set keyword splat flag after splat arguments. [ruby-core:83638] [Bug #10856] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01test_syntax.rb: all assertionsnobu
* test/ruby/test_syntax.rb (test_return_toplevel): try all assertions even if any assertions failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01file.c: infect from argumentsnobu
* file.c (rb_check_realpath_internal): infetct the result with arguments, no taint if none are tainted and cwd is not used. [ruby-core:83583] [Bug #14060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01revert r60596 because it cause faulure on TestFile#test_realpath_taintednessko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01file.c: infect from argumentsnobu
* file.c (rb_check_realpath_internal): infetct the result with arguments, no taint if none are tainted and cwd is not used. [ruby-core:83583] [Bug #14060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31compile.c: ensure after return in library toplevelnobu
* compile.c (compile_return): execute ensure clause after toplevel return even in library toplevel other than the main script. [ruby-core:83589] [Bug #14061] test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30webrick: support Proc objects as body responsesnormal
* lib/webrick/httpresponse.rb (send_body): call send_body_proc (send_body_proc): new method (class ChunkedWrapper): new class * test/webrick/test_httpresponse.rb (test_send_body_proc): new test (test_send_body_proc_chunked): ditto [Feature #855] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29io.c: honor buffered modenobu
* io.c (io_writev): honor buffered mode to get rid of broken pipe error when stdout is redirected to a pipeline. [ruby-core:83578] [Feature #14042] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29io.c: convert to string at writevnobu
* io.c (io_fwritev): needs conversion to string before accessing the content, as well as single argument case, not to segfault. [Feature #9323] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27socket: fix BasicSocket#*_nonblock buffering bugs from r58400normal
IO#read_nonblock and IO#write_nonblock take into account buffered data, so the Linux-only BasicSocket#read_nonblock and BasicSocket#write_nonblock methods must, too. This bug was only introduced in r58400 ("socket: avoid fcntl for read/write_nonblock on Linux") and does not affect any stable release. * ext/socket/basicsocket.c (rsock_init_basicsocket): * ext/socket/init.c (rsock_s_recvfrom_nonblock): * ext/socket/init.c (rsock_init_socket_init): * ext/socket/lib/socket.rb (def read_nonblock): * ext/socket/lib/socket.rb (def write_nonblock): * ext/socket/rubysocket.h (static inline void rsock_maybe_wait_fd): * test/socket/test_basicsocket.rb (def test_read_write_nonblock): [Feature #13362] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27skip tests temporarilyko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27io.c: fix IO.copy_stream on O_APPEND destination on Linuxnormal
Linux copy_file_range(2) fails with EBADF if the destination FD has O_APPEND set. Preserve existing (Ruby <= 2.4) behavior by falling back to alternative copy mechanisms if this is the case (instead of raising Errno::EBADF). * io.c (nogvl_copy_file_range): do not raise on O_APPEND dst * test/ruby/test_io.rb (test_copy_stream_append): new test [Feature #13867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27Revert "Revert "Manage AST NODEs out of GC""mame
This re-introduces r60485. This reverts commit 5a176b75b1187cbd3861c387bde65ff66396a07c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27Revert "Manage AST NODEs out of GC"mame
This reverts commit 620ba74778bfdbdc34ffbb142d49ce84a0ef58e9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27Manage AST NODEs out of GCmame
NODEs in AST are no longer objects managed by GC. This change will remove the restriction imposed by the GC. For example, a NODE can use more than five words (this is my primary purpose; we want to store the position data for each NODE, for coverage library), or even a NODE can have variable length (some kinds of NODEs have unused fields). To do this, however, we need more work, since Ripper still uses T_NODE objects managed by the GC. The life time of NODEs is more obvious than other kinds of objects; they are created at parsing, and they become disused immediately after compilation. This change releases all NODEs by a few `xfree`s after compilation, so performance will be improved a bit. In extreme example, `eval("x=1;" * 10000000)` runs much faster (40 sec. -> 7.8 sec. on my machine). The most important part of this change is `ast_t` struct, which has three contents: (1) NODE buffer (malloc'ed memory), (2) a reference to the root NODE, and (3) an array that contains objects that must be marked during parsing (such as literal objects). Some functions that had received `NODE*` arguments, must now receive `ast_t*`. * node.c, node.h: defines `ast_t` struct and related operations. * gc.c, internal.h: defines `imemo_ast`. * parse.y: makes `parser_params` struct have a reference to `ast_t`. Instead of `rb_node_newnode`, use `rb_ast_newnode` to create a NODE. * iseq.c, load.c, ruby.c, template/prelude.c.tmpl: modifies some functions to handle `ast_t*` instead of `NODE*`. * test/ruby/test_gc.rb: ad-hoc fix for a failed test. The test assumes GC eden is increased at startup by NODE object creation. However, this change now create no NODE object, so GC eden is not necessarily increased. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-27Revert "Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]"naruse
This reverts commit r60341,r60342,r60344,r60345. Breaking compabitility of the order of result breaks many tests. To avoid such effort to fix tests, the order should be kept. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26Host header should add branckets to IPv6 address [Bug #12642]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26make root fiber at switching.ko1
* cont.c (fiber_switch): make sure the root fiber object is available before the first switching. * test/ruby/test_fiber.rb: remove "skip". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26skip test_fiber_transfer_segv because it cause error with previous commitko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26test_env.rb: fix one-off bugnobu
* test/ruby/test_env.rb (TestEnv#test_win32_blocksize): count the terminator byte too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26TracePoint#enable, #disable: Don't yield any argument. [Bug #14057]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25test/ostruct: Specify frozen_string_literal: true.kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25Get rid of a test error on Windows caused by r60417usa
* test/testunit/test_parallel.rb (teardown): this code seems to allow `Errno::EPIPE` from @worker_in. in such case, `close` may also raise the same exception. I'm not confident in this conclusion and still doubt that we should revert r60417 instead of this commit or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25test_io.rb: skip writev testnobu
* test/ruby/test_io.rb (TestIO#test_puts_parallel): skip a test needs writev which is not portable. [Feature #14042] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25io.c: warn old writenobu
* io.c (rb_io_puts): warn if write method accepts just one argument. [ruby-core:83529] [Feature #14042] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25io.c: write a newline togethernobu
* io.c (rb_io_puts): write a newline together at once for each argument. based on the patch by rohitpaulk (Rohit Kuruvilla) at [ruby-core:83508]. [Feature #14042] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25range.c: use rb_check_funcallnobu
* range.c (rb_range_values): use rb_check_funcall instead of calling rb_respond_to then rb_funcall, and allow `begin` and `end` to be private as well as other internal conversions. [ruby-core:83541] [Bug #14048] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25range.c: check if exclude_end? is definednobu
* range.c (rb_range_values): should raise TypeError if necessary method is not defined, not NoMethodError, when trying to tell if the object is a Range and extract info. [ruby-core:83541] [Bug #14048] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24lib/ostruct.rb: Use frozen literals.marcandre
Patch adapted from Espartaco Palma. [GH-1714] [Bug #14000] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24Test for r60396nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24Lazy Proc allocation for block parametersko1
[Feature #14045] * insns.def (getblockparam, setblockparam): add special access instructions for block parameters. getblockparam checks VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM and if it is not set this instruction creates a Proc object from a given blcok and set VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM. setblockparam is similar to setlocal, but set VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM. * compile.c: use get/setblockparm instead get/setlocal instructions. Note that they are used for method local block parameters (def m(&b)), not for block local method parameters (iter{|&b|). * proc.c (get_local_variable_ptr): creates Proc object for Binding#local_variable_get/set. * safe.c (safe_setter): we need to create Proc objects for postponed block parameters when $SAFE is changed. * vm_args.c (args_setup_block_parameter): used only for block local blcok parameters. * vm_args.c (vm_caller_setup_arg_block): if called with VM_CALL_ARGS_BLOCKARG_BLOCKPARAM flag then passed block values should be a block handler. * test/ruby/test_optimization.rb: add tests. * benchmark/bm_vm1_blockparam*: added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23multiple arguments to writenobu
Make write methods of IO-like objects accept multiple arguments, as well as IO#write. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23Add test cases for branch coverageyui-knk
* test/coverage/test_coverage.rb (test_branch_coverage_for_while_statement): Add test cases for modifier while/until. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23OpenSSL may show the different error messagenaruse
https://github.com/ruby/ruby/commit/d02211c9da608742b09aec768db79442007eabc0#commitcomment-25119729 From: MSP-Greg <MSP-Greg@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23zlib.c: multiple arguments to writenobu
* ext/zlib/zlib.c (rb_gzwriter_write): accepts multiple arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23stringio.c: write multiple argumentsnobu
* ext/stringio/stringio.c (strio_write_m): make StringIO#write accept multiple arguments, as well as IO#write. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23io.c: fix infinite retrynobu
* io.c (io_binwritev): fix infinite retry when flushing buffered data. [Feature #9323] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23io.c: fix buffered outputnobu
* io.c (io_binwritev): append to buffered data, not overwriting. [Feature #9323] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23io.c: no restrictionnobu
* io.c (io_write_m): remove argc restriction upto IOV_MAX-1. [Feature #9323] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22rss itunes: fix a bug that <itunes:explicit> value isn't fully supportedkou
Fix GH-1725 <itunes:explicit> accepts "explicit", "yes", "true", "clean", "no" and "false" as valid values. Here is the <itunes:explicit>'s description in https://help.apple.com/itc/podcasts_connect/#/itcb54353390: > The <itunes:explicit> tag indicates whether your podcast contains > explicit material. You can specify the following values: > > * Yes | Explicit | True. If you specify yes, explicit, or true, > indicating the presence of explicit content, the iTunes Store > displays an Explicit parental advisory graphic for your podcast. > > * Clean | No | False. If you specify clean, no, or false, indicating > that none of your podcast episodes contain explicit language or > adult content, the iTunes Store displays a Clean parental > advisory graphic for your podcast. I don't know whether <itunes:explicit> value is case sensitive or insensitive. But the current implementation is case insensitive. Reported by Valerie Woolard Srinivasan. Thanks!!! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Add test cases for branch coverageyui-knk
* test/coverage/test_coverage.rb (test_branch_coverage_for_if_statement): Add a test case for ternary operator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Add test cases for branch coverageyui-knk
* test/coverage/test_coverage.rb (test_branch_coverage_for_if_statement): Add test cases for modifier if/unless. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Add test cases for branch coverageyui-knk
* test/coverage/test_coverage.rb (test_branch_coverage_for_if_statement): Add test cases for if/unless without else clauses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22test/coverage/test_coverage.rb: Use `<<~` to ease to calculate column of ↵yui-knk
target codes git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Add column numbers to branch coverageyui-knk
* compile.c (DECL_BRANCH_BASE, ADD_TRACE_BRANCH_COVERAGE): Add column to arguments. * compile.c (compile_if, compile_case, compile_when, compile_loop, iseq_compile_each0): Pass column numbers to macros. * ext/coverage/coverage.c (branch_coverage): Add column numbers to a return value. * test/coverage/test_coverage.rb: Follow-up these changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Add `Set#reset`knu
This method resets the internal state of a set after modification to existing elements, reindexing and deduplicating them. [Feature #6589] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e