summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2018-01-15parse.y: Fix a bug of `obj[42, &blk] ||= foo bar`mame
Follow up of r28123 (!) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-11fix for IPv6 envnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-11Mock fetching data from real DNS [Feature #14340]naruse
This test just tests MDNS#each_address method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-11Fix indent and use as skipped message instead of commentkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-11iseq.c: child iseq encodingnobu
* iseq.c (iseq_inspect): preserve the encoding of child iseqs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-11vm_insnhelper.c: search in the indexing ordernobu
* vm_insnhelper.c (vm_opt_newarray_max, vm_opt_newarray_min): search in the indexing order, as well as usual methods. [ruby-core:84821] [Bug #14350] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-10skip some tests so that no failure occurs in root privilegemame
Some tests had failed on `sudo make test-all`, mainly because root can access any files regardless of permission. This change adds `skip` guards into such tests. Note that almost all tests in which `skip` guards is added, already have "windows" guard. This is because there is no support to avoid read access by owner on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09parse.y: insane syntax too (class definition in cond)mame
This change partially reverts r61724 and take another approach: exploiting struct local_vars to backup the cond_stack state. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09parse.y: insane syntaxnobu
* parse.y (primary): save/restore COND and CMDARG stacks at method definition, to distinguish do_block and do_cond properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09Allow `-> do rescue; end` as well as `proc do rescue; end`mame
https://twitter.com/takiuchi/status/950593389963051008 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-08vm.c: respect redefinition of Proc#callnobu
* vm.c (vm_redefinition_check_method_type): hoist out method definition type to check redefinition. * vm.c (rb_vm_check_redefinition_opt_method): should check optimized method too. * vm.c (vm_init_redefined_flag): check Proc#call. * vm_insnhelper.c (vm_call_opt_block_call): search proper method if redefined. [Bug #14335] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-07parse.y: nd_line of new_qcallnobu
* parse.y (new_qcall): set nd_line to the method name location. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-07eval_error.c: reset in each linenobu
* eval_error.c (print_errinfo): reset in each line, so that Exception#full_message ends with a newline and puts will not print an extra newline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-07test_exception.rb: fix messagenobu
* test/ruby/test_exception.rb (test_full_message): fix method name in a message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-06net/ftp: fix FrozenError in BufferedSocketnormal
I noticed this bug while working on something else with RUBYOPT=-d on, existing test cases all passed with it. Note: I use String.new because it is the local style, here, I prefer +'' (or ''.b, for a future commit) * lib/net/ftp.rb (BufferedSocket#read): use String.new * test/net/ftp/test_buffered_socket.rb (test_read_nil): new test [ruby-core:84675] [Bug #14323] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-06test_process.rb: skip not-found groupsnobu
* test/ruby/test_process.rb (test_execopts_gid): under some network configuration (maybe with Open Directory but disconnected temporarily), some groups may fail to find. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05Extend timeout of test_clear_unreachable_keyword_argsnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05Show how many seconds it timeoutsnaruse
By this we can easily extend timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05extend timeout to 15 seconds for ARMv8 environmentnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05compile.c: fix stack consistency errornobu
* compile.c (iseq_peephole_optimize): fix stack consistency error from return in loop, by adding extra `pop` when replacing `jump` with `leave`, which is never reached but needed to adjust sp calculation. [ruby-core:84589] [Bug #14273] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05marshal.c: allow marshalling keyword_init structk0kubun
struct.c: define rb_struct_s_keyword_init to shared with marshal.c internal.h: add the declaration to be used by marshal.c test/ruby/test_marshal.rb: add test for Bug#14314 [Feature #14314] [ruby-core:84629] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05check array for zsuper. [Bug #14279]ko1
* compile.c (iseq_compile_each0): for zsuper (NODE_ZSUPER), we need to check given argument is Array or not. * test/ruby/test_super.rb: add a test for this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-04test/ruby/test_io.rb: relax RLIMIT_NPROC for invocation of rubymame
This limit seems to be too restrict. It sometimes produces the following warning when running `make test-all`: ``` TestIO#test_close_on_exec<main>: warning: pthread_create failed for timer: Resource temporarily unavailable, scheduling broken ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-04test_iseq_load.rb: set locationnobu
* test/-ext-/iseq_load/test_iseq_load.rb (assert_iseq_roundtrip): set path and line number from callers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-02long long is a C99ismshyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-02parse.y: code end positionnobu
* parse.y (parser_yyerror): use the given location as the end of erred code, instead of the current position. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-31Removed debug code. It is inconsistency in rubygems upsteream.hsbt
Revert r58657, r58660, r58692, r58723. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-31test_exception.rb: more assertionsnobu
[ruby-core:84568] [Bug #14262] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-31error.c: negative uplevelnobu
* error.c (rb_warn_m): negative uplevel is not allowed. [ruby-core:84568] [Bug #14262] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-31parse.y: assignable_errornobu
* parse.y (assignable_gen): should return valid NODE always even on errors. [ruby-core:84565] [Bug #14261] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-30increase test timeout.ko1
* test/ruby/test_thread.rb (test_signal_at_join): increase timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-30numeric.c: Fix Integer#pow with a large Fixnum modulomrkn
* numeric.c: Fix Integer#pow with a large Fixnum modulo [Bug #14259] [ruby-core:84562] * test/ruby/test_numeric.rb: add assertions for reproducing this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-30drb: use \A and \znobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-30hash literal deduplicates like Hash#[]=normal
From: Eric Wong <e@80x24.org> * hash.c (rb_hash_key_str): new function (hash_aset_str): use rb_hash_key_str * internal.h: add rb_hash_key_str * st.c (st_stringify): use rb_hash_key_str * test/ruby/test_hash.rb (test_NEWHASH_fstring_key): dynamic key [ruby-core:84554] [Feature #14258] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-29string.c: chomp rs at the endnobu
* string.c (rb_str_enumerate_lines): should chomp record separator only, but not a newline, at the end of the receiver as well as middle, if the separator is given. [ruby-core:84552] [Bug #14257] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-29test/ruby/test_hash: minor test cleanupnormal
Prep work for proposed behavior change: https://bugs.ruby-lang.org/issues/14225 * test/ruby/test_hash.rb (test_tainted_string_key): assert_predicate git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-28`$SAFE` as a process global state. [Feature #14250]ko1
* vm_core.h (rb_vm_t): move `rb_execution_context_t::safe_level` to `rb_vm_t::safe_level_` because `$SAFE` is a process (VM) global state. * vm_core.h (rb_proc_t): remove `rb_proc_t::safe_level` because `Proc` objects don't need to keep `$SAFE` at the creation. Also make `is_from_method` and `is_lambda` as 1 bit fields. * cont.c (cont_restore_thread): no need to keep `$SAFE` for Continuation. * eval.c (ruby_cleanup): use `rb_set_safe_level_force()` instead of access `vm->safe_level_` directly. * eval_jump.c: End procs `END{}` doesn't keep `$SAFE`. * proc.c (proc_dup): removed and introduce `rb_proc_dup` in vm.c. * safe.c (rb_set_safe_level): don't check `$SAFE` 1 -> 0 changes. * safe.c (safe_setter): use `rb_set_safe_level()`. * thread.c (rb_thread_safe_level): `Thread#safe_level` returns `$SAFE`. It should be obsolete. * transcode.c (load_transcoder_entry): `rb_safe_level()` only returns 0 or 1 so that this check is not needed. * vm.c (vm_proc_create_from_captured): don't need to keep `$SAFE` for Proc. * vm.c (rb_proc_create): renamed to `proc_create`. * vm.c (rb_proc_dup): moved from proc.c. * vm.c (vm_invoke_proc): do not need to set and restore `$SAFE` for `Proc#call`. * vm_eval.c (rb_eval_cmd): rename a local variable to represent clearer meaning. * lib/drb/drb.rb: restore `$SAFE`. * lib/erb.rb: restore `$SAFE`, too. * test/lib/leakchecker.rb: check `$SAFE == 0` at the end of tests. * test/rubygems/test_gem.rb: do not set `$SAFE = 1`. * bootstraptest/test_proc.rb: catch up this change. * spec/ruby/optional/capi/string_spec.rb: ditto. * test/bigdecimal/test_bigdecimal.rb: ditto. * test/fiddle/test_func.rb: ditto. * test/fiddle/test_handle.rb: ditto. * test/net/imap/test_imap_response_parser.rb: ditto. * test/pathname/test_pathname.rb: ditto. * test/readline/test_readline.rb: ditto. * test/ruby/test_file.rb: ditto. * test/ruby/test_optimization.rb: ditto. * test/ruby/test_proc.rb: ditto. * test/ruby/test_require.rb: ditto. * test/ruby/test_thread.rb: ditto. * test/rubygems/test_gem_specification.rb: ditto. * test/test_tempfile.rb: ditto. * test/test_tmpdir.rb: ditto. * test/win32ole/test_win32ole.rb: ditto. * test/win32ole/test_win32ole_event.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-28Fix KeyError#{key,receiver} of Thread#fetchkazu
[ruby-core:84508] [Bug #14247] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27fix concurrent test.ko1
* test/rubygems/test_require.rb (test_concurrent_require): Synchronizations should be in ensure clause. Sometimes `require` fails (not sure why) and latch is not released. Such case introduces unlimited awaiting. This patch soleve this problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27erb.rb: preserve the behavior for invalid syntaxk0kubun
comment. Fix regression at r58948. I even don't want to deprecate it because deprecation needs to lex all embedded Ruby script using Ripper and it would be slow. So Let me just keep this behavior of Ruby 2.4. No change is the best compatibility. This commit stopped using String#-@ because it's harmful for "ambiguous first argument" warning if we really want to maintain this behavior. [Bug #14243] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-26test_proc.rb: remove duplicate test_source_locationnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-26vm_method.c: fix super in refined modulenobu
* vm_method.c (rb_method_entry_complement_defined_class): clone the original method entry of refined module instance method with the active ICLASS, to track super method chain. [ruby-dev:50390] [Bug #14232] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-26parse.y: warning for locationsnobu
* parse.y (gettable_gen): warn for __FILE__/__LINE__ when eval with binding only. promote use of Binding#source_location instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-26vm_eval.c: strange message in evalnobu
* vm_eval.c (eval_string_with_cref): remove unnecessary location from exception backtrace in eval. [ruby-core:84434] [Bug #14229] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-26test/ruby/test_proc.rb: Add a test for Binding#source_locationmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-25test/ruby/test_process.rb: get rid of timing issuenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-25Set first line numbers for empty iseqs.ko1
* compile.c (iseq_compile_each): for empty method, block and so on, `last_line` is not set so that line number of `putnil` instruction will be zero. This patch set `first_lineno` for such `putnil`. Problem is reported by deivid-rodriguez via Yuichiro Kaneko. * test/ruby/test_iseq.rb: add a test for this spec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-24bigdecimal: version 1.3.4mrkn
Import bigdecimal version 1.3.4. The full commit log is here: https://github.com/ruby/bigdecimal/compare/v1.3.3...v1.3.4 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-24compile.c: toplevel return argumentsnobu
* compile.c (compile_return): evaluate arguments to top-level return but ignore the results. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-23RubyVM::InstructionSequence#trace_points.ko1
* iseq.c (iseqw_trace_points): add `RubyVM::InstructionSequence#trace_points` method for tools which want to manipulate ISeq (and traces). * test/ruby/test_iseq.rb: add a test for this method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e