aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Do not define test method instead of skip when Calendar class is not defined.hsbt2017-11-104-17/+5
| | | | | | | Revisit r34739. Patch by MSP-Greg. [Bug #14088][ruby-core:83690][fix GH-1743] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* TracePoint.new: raise ArgumentError when no block given [#14074]marcandre2017-11-091-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix backtrace on argment error.ko12017-11-091-0/+27
| | | | | | | | | | | * vm_backtrace.c (rb_backtrace_use_iseq_first_lineno_for_last_location): added. It modifies last location's line as corresponding iseq's first line number. * vm_args.c (raise_argument_error): use added function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix peephole optimization.ko12017-11-091-0/+7
| | | | | | | | | | | | * compile.c (iseq_peephole_optimize): do not need to put `pop` instruction. * test/ruby/test_optimization.rb (test_peephole_optimization_without_trace): This code "def foo; 1.times{|(a), &b| nil && a}; end" fails to compile by stack underflow because of above bug (fixed by this patch). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* disable GC.ko12017-11-071-4/+9
| | | | | | | | * test/ruby/test_io.rb (test_write_no_garbage): malloc can cause GC and it will reduce string object counts. So disable GC during this test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enum.c: check argument firstnobu2017-11-052-1/+5
| | | | | | | * enum.c (enum_cycle_size): check an argument before the size of the receiver, if it is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_lazy_enumerator.rb: test for [Bug #14082]nobu2017-11-051-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix size on Enumerable#cycle when the size is 0 [Bug #14082].marcandre2017-11-051-0/+7
| | | | | | Patch by Kenichi Kamiya git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/win32ole/lib/win32ole.rb (metods): rescue WIN32OLEQueryInterfaceError.suke2017-11-051-4/+9
| | | | | | | test/win32ole/test_win32ole.rb: add test for WIN32OLE#methods git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/win32ole/test_win32ole_method.rb: remove redundant assertions.suke2017-11-051-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_io.rb (test_write_no_garbage): Add detailed messagemame2017-11-041-1/+1
| | | | | | | | I saw this test failed once. There is no problem if `before > after` but we cannot check it. To allow diagnosis in future, the detailed message is added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: pull test case from upstream commit 62af0446569arhe2017-11-041-23/+14
| | | | | | | | | | 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
* test/ruby/test_eval.rb: use orphan procsnobu2017-11-031-3/+10
| | | | | | | 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
* skip/fix wrong testsnobu2017-11-022-1/+9
| | | | | | | * 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
* assertions.rb: fix return in assert_raisenobu2017-11-022-4/+18
| | | | | | | * 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
* compile.c: kw splat after splatnobu2017-11-021-0/+6
| | | | | | | * 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
* test_syntax.rb: all assertionsnobu2017-11-011-6/+7
| | | | | | | * 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
* file.c: infect from argumentsnobu2017-11-011-0/+20
| | | | | | | | * 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
* revert r60596 because it cause faulure on TestFile#test_realpath_taintednessko12017-11-011-17/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: infect from argumentsnobu2017-11-011-0/+17
| | | | | | | | * 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
* compile.c: ensure after return in library toplevelnobu2017-10-311-5/+16
| | | | | | | | | | * 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
* webrick: support Proc objects as body responsesnormal2017-10-301-0/+23
| | | | | | | | | | | | * 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
* io.c: honor buffered modenobu2017-10-291-0/+9
| | | | | | | | * 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
* io.c: convert to string at writevnobu2017-10-291-0/+4
| | | | | | | | * 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
* socket: fix BasicSocket#*_nonblock buffering bugs from r58400normal2017-10-271-0/+21
| | | | | | | | | | | | | | | | | | | | | 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
* skip tests temporarilyko12017-10-271-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: fix IO.copy_stream on O_APPEND destination on Linuxnormal2017-10-271-0/+10
| | | | | | | | | | | | | 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
* Revert "Revert "Manage AST NODEs out of GC""mame2017-10-271-0/+3
| | | | | | | 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
* Revert "Manage AST NODEs out of GC"mame2017-10-271-3/+0
| | | | | | This reverts commit 620ba74778bfdbdc34ffbb142d49ce84a0ef58e9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Manage AST NODEs out of GCmame2017-10-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert "Dir.glob with FNM_EXTGLOB is optimized [Feature #13873]"naruse2017-10-272-8/+4
| | | | | | | | 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
* Host header should add branckets to IPv6 address [Bug #12642]naruse2017-10-261-0/+27
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make root fiber at switching.ko12017-10-261-1/+0
| | | | | | | | | | * 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
* skip test_fiber_transfer_segv because it cause error with previous commitko12017-10-261-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_env.rb: fix one-off bugnobu2017-10-261-1/+1
| | | | | | | * 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
* TracePoint#enable, #disable: Don't yield any argument. [Bug #14057]marcandre2017-10-261-2/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ostruct: Specify frozen_string_literal: true.kazu2017-10-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Get rid of a test error on Windows caused by r60417usa2017-10-251-2/+6
| | | | | | | | | | | * 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
* test_io.rb: skip writev testnobu2017-10-251-0/+1
| | | | | | | * 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
* io.c: warn old writenobu2017-10-251-0/+16
| | | | | | | * 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
* io.c: write a newline togethernobu2017-10-251-0/+13
| | | | | | | | * 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
* range.c: use rb_check_funcallnobu2017-10-251-0/+3
| | | | | | | | | * 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
* range.c: check if exclude_end? is definednobu2017-10-252-1/+14
| | | | | | | | | * 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
* lib/ostruct.rb: Use frozen literals.marcandre2017-10-241-0/+2
| | | | | | 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
* Test for r60396nobu2017-10-241-0/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Lazy Proc allocation for block parametersko12017-10-241-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [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
* multiple arguments to writenobu2017-10-236-8/+8
| | | | | | | 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
* Add test cases for branch coverageyui-knk2017-10-231-2/+8
| | | | | | | * 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
* OpenSSL may show the different error messagenaruse2017-10-231-1/+2
| | | | | | | 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
* zlib.c: multiple arguments to writenobu2017-10-231-0/+8
| | | | | | * 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