* test/test_tempfile.rb (test_default_basename): use assert_file
for more descriptive message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
type_alias
* test/fiddle/test_cparser.rb: added type_alias test for parse_ctype
and parse_struct_signature.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to connect to a server. Patch by @xaviershay [fix GH-700]
* test/net/http/test_http.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to handle rich signatures including parameter names and function
pointer types. Patch by @theryan [fix GH-590]
* test/fiddle/test_cparser.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/lib/tracepointchecker.rb (TracePointChecker): needs recent
version of TracePoint, so that older versions can run to compare
the resuls.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/lib/leakchecker.rb (check_fd_leak): do not call older
version IO.console to get rid of ArgumentError, so that older
versions can run to compare the resuls.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_yield.rb (assert_all_sentences): test all
sentences and report all results at the end.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/lib/tracepointchecker.rb: available only if TracePoint is
available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_m17n.rb (TestM17N#test_scrub): split into some
tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c (rb_gc_free_dsymbol): delete from global fstr hash
* test/ruby/test_symbol.rb (test_symbol_fstr_leak): test for bug
[ruby-core:67268] [Bug #10686]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_args.c (keyword_hash_p): fix non-symbol keys hash.
rb_extract_keywords() returns 0 not Qnil when no symbol keys is
included.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (gettable_gen): disable warnings of possible reference
to a local variable defined in a past scope.
[ruby-core:67162] [Bug #10661]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/resolv.rb (Resolv::DNS::Name#==): DNS is case-insensitive, so the
comparison should be case-insensitive as well.
[ruby-core:66498] [Bug #10550]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/resolv.rb (Resolv::DNS::Name): names with different dots
should be different.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/test_time.rb (subtest_xmlschema_alias): test the specified
method, not fixed name iso8601.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c (rb_thread_variable_get): fix dynamic symbol keys.
rb_check_id() returns non-zero only for static symbols, whereas
thread local variable keys can be dynamic symbols.
[ruby-core:67185] [Bug #10667]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
We can ensure the loader works for these cases even if the
reoptimized bytecode is not a match for the original.
* test/-ext-/iseq_load/test_iseq_load.rb
(test_next_in_block_in_block): test using ISeq#eval
(test_break_ensure): ditto
[ruby-core:66988]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (f_kwrest, new_args_tail_gen): unnamed rest keyword and
keywords bits arguments should be unique. since internal IDs
depend on the local variable index in the current scope, new ID
should be made before popping those vtables.
[ruby-core:67157] [Bug #10659]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/io/console/test_io_console.rb (test_noctty): use different
names for each tempfiles.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/io/console/console.c (console_dev): send the given arguments
to the opened console. as a special case, do nothing if :close
is given.
* test/lib/leakchecker.rb (LeakChecker#check_fd_leak): close if
console.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_file_expand_path_internal): drop characters ignored
by filesystem on Mac OS X.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c (replace_real_basename): get the real name and replace the
base name with it by getattrlist(2) if available.
suggested by Matthew Draper at [ruby-core:67116]. [Bug #10015]
* dir.c (glob_helper): get the real name of the whole path, not
only the last name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/io/console/test_io_console.rb (run_pty): pty cannot read
all, should use gets only.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/io/console/test_io_console.rb (run_pty): IO#readlines
ignores the given block. need map to chomp the results.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (gettable_gen): warn possible reference to a local
variable defined in a past scope.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/io/console/console.c (console_dev): id_console is not a
constant name, use rb_const_remove() to get rid of NameError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
set timeout for recvfrom because if client thread is crashed, it
waits infinity.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_gc.rb (test_interrupt_in_finalizer): also check
termsig to ensure killed by SIGINT. and try SIGSEGV to dump
something.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c (iseq_compile_each): only emit opt_str_freeze,
opt_aref_with, and opt_aset_with insn when no block is given
[Bug #10557] [ruby-core:66595]
* test/ruby/test_optimization.rb (test_block_given_aset_aref):
new test for bug thanks to Bartosz Kopinski.
(test_string_freeze): additional assertion for object_id
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_rubyoptions.rb (test_segv_loaded_features): clean
crash log on OS X after intentional segv.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (primary): restore current_arg so that circular
reference after a method definition is also warned.
[ruby-core:61299] [Bug #9593]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_gc.rb (test_interrupt_in_finalizer): use inner
process signal for Windows. [ruby-core:66825] [Bug #10595]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_gc.rb (test_interrupt_in_finalizer): wait longer
and send more interrupts for slower cases.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_trace.c (rb_postponed_job_flush): mask signal trap interrupt
too to defer handling after finalizers finished.
[ruby-core:66825] [Bug #10595]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/open-uri/test_ssl.rb, test/webrick/test_httpproxy.rb: also
depends on test/openssl/utils.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/net/http/test_https.rb (TestNetHTTPS): also depends on
test/openssl/utils.rb
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This prevents excessive memory growth when a WeakRef
is repeatedly created
* gc.c (define_final0): avoid duplicate blocks
[Bug #10537]
* test/test_weakref.rb (test_repeated_object_leak): new test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/openssl/test_ocsp.rb (test_new_ocsp_request): run in a
separated process to continue on CentOS 5.6 i386.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* bin/erb (ARGV.switch, ERB::Main#run): allow variables to be set
from the command line. [ruby-core:65772] [Feature #10395]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/erb.rb (ERB#lineno): accessor for line number to eval.
* lib/erb.rb (ERB#location=): setter of file name and line number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_crypt): check arguments more strictly.
* crypt() is not for wide char strings
* salt bytes should not be NUL
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/lib/envutil.rb (invoke_ruby): kill whole group when :pgroup
option is set.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/-ext-/string/test_cstr.rb (assert_wchars_term_char): test
for all wide char encodings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/-ext-/string/test_cstr.rb (test_wchar_long): show the
failed encoding name in error messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(TestNetHTTPS#test_certificate_verify_failure): on Windows,
Errno::ECONNRESET will be raised when the verify is failure at the
client side, and it'll be eaten by WEBrick.
* test/open-uri/test_ssl.rb (TestOpenURISSL#test_validation_failure):
ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This avoids O(n) on lookups with structs over 10 members.
This also avoids O(n) behavior on all assignments on Struct members.
Members 0..9 still use existing C methods to read in O(1) time
Benchmark results:
vm2_struct_big_aref_hi* 1.305
vm2_struct_big_aref_lo* 1.157
vm2_struct_big_aset* 3.306
vm2_struct_small_aref* 1.015
vm2_struct_small_aset* 3.273
Note: I chose use loading instructions from an array instead of writing
directly to linked-lists in compile.c for ease-of-maintainability. We
may move the method definitions to prelude.rb-like files in the future.
I have also tested this patch with the following patch to disable
the C ref_func methods and ensured the test suite and rubyspec works
--- a/struct.c
+++ b/struct.c
@@ -209,7 +209,7 @@ setup_struct(VALUE nstr, VALUE members)
ID id = SYM2ID(ptr_members[i]);
VALUE off = LONG2NUM(i);
- if (i < N_REF_FUNC) {
+ if (0 && i < N_REF_FUNC) {
rb_define_method_id(nstr, id, ref_func[i], 0);
}
else {
* iseq.c (rb_method_for_self_aref, rb_method_for_self_aset):
new methods to generate bytecode for struct.c
[Feature #10575]
* struct.c (rb_struct_ref, rb_struct_set): remove
(define_aref_method, define_aset_method): new functions
(setup_struct): use new functions
* test/ruby/test_struct.rb: add test for struct >10 members
* benchmark/bm_vm2_struct_big_aref_hi.rb: new benchmark
* benchmark/bm_vm2_struct_big_aref_lo.rb: ditto
* benchmark/bm_vm2_struct_big_aset.rb: ditto
* benchmark/bm_vm2_struct_small_aref.rb: ditto
* benchmark/bm_vm2_struct_small_aset.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (rb_frame_last_func): return the most recent frame method
name.
* thread.c (recursive_list_access): use the last method name,
instead of the current method name which can be unset in some
cases, not to use a symbol by the invalid ID.
[ruby-core:66742] [Bug #10579]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
causes Errno::ECONNRESET or Errno::ECONNABORTED instead of Errno::EPIPE on
Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_rubyoptions.rb (test_command_line_glob_noncodepage):
test for command line globbing on non-codepage names.
[ruby-dev:48752] [Bug #10555]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_yylex): fix lex_state after tLABEL_END, should
be EXPR_LABELARG to be followed by "paren with arg".
[ruby-core:66705] [Feature #4935]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This allows reporters commenters of [Feature #8543] to load
instruction sequences directly. Some test cases are still failing
but documented in test/-ext-/iseq_load/test_iseq_load.rb.
* compile.c (rb_iseq_build_from_exception): entry->sp is unsigned
(iseq_build_callinfo_from_hash): account for kw_arg
(iseq_build_from_ary_body): update for r35459
(CHECK_STRING, CHECK_INTEGER): remove unused checks
(int_param): new function for checking new `params' hash
(iseq_build_kw): new function for loading rb_iseq_param_keyword
(rb_iseq_build_from_ary): account for `misc' entry and general
structure changes
[Feature #8543]
* iseq.c (CHECK_HASH): new macro (for `misc' and `param' entries)
(iseq_load): account for `misc' and `params' hashes
(iseq_data_to_ary): add final opt to arg_opt_labels,
fix kw support, account for unsigned entry->sp
* ext/-test-/iseq_load/iseq_load.c: new ext for test
* ext/-test-/iseq_load/extconf.rb: ditto
* test/-ext-/iseq_load/test_iseq_load.rb: new test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Compile failures will trigger iseq_free before
iseq->callinfo_entries are allocated at all.
* iseq.c (iseq_free): avoid segfault on incomplete iseq
* test/ruby/test_syntax.rb (test_invalid_next): new test
for syntax error, not segfault
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
marshalable, but inherit from basic object.
Thanks Sean Griffin <sean@thoughtbot.com>
* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
* test/psych/test_marshalable.rb: test for fix
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (magic_comment_encoding): enable in ripper, since the
encoding is necessary to parse non-default encoding scripts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
use hostname= to detect and wrap IPv6 hosts.
Build is accepting URI components and users may not expect
that a host component needs to be wrapped with square brackets
since it's not providing a URI.
Note: initialize with arg_check => true does not wrap IPv6 hosts.
by Joe Rafaniello <jrafanie@redhat.com>
https://github.com/ruby/ruby/pull/765 fix GH-765
* test/uri/test_generic.rb: Add more tests
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c (process_options, ruby_script): transcode script name and
program name to locale encoding as well as argv.
[ruby-dev:48752] [Bug #10555]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_rubyoptions.rb (test_command_line_glob_nonascii):
workaround for other than cp932. [ruby-dev:48752] [Bug #10555]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c (ruby_set_argv): convert argv from UTF-8.
* win32/win32.c (rb_w32_sysinit, cmdglob, w32_cmdvector): convert
wide char command line to UTF-8 argv, and glob in UTF-8 so that
metacharacters would match multibyte characters.
[ruby-dev:48752] [Bug #10555]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
For example, the following program
def foo(k1: 1); end # line 1
foo(k2: 2) # line 2
causes "unknown keyword: k2 (ArgumentError)".
Before this patch, the backtrace location is only line 2.
However, error should be located at line 1 (over line 2 in
stack trace). This patch fix this problem.
* class.c (rb_keyword_error_new): separate exception creation logic
from rb_keyword_error(), to use in vm_args.c.
* vm_insnhelper.c (rb_arg_error_new): rename to rb_arity_error_new().
* vm_args.c (argument_arity_error): rename to argument_arity_error().
* vm_args.c (arugment_kw_error): added to fix backtrace.
* test/ruby/test_keyword.rb: add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_const.rb (test_redefinition): should use
assert_warning for warning message test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
from Continuation to Date. Becouse Continuation is no longer quiet.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c (rb_mod_remove_method): preserve encodings of method
name and class name in error messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c (rb_method_call_status): preserve encoding of called method
name in error messages.
* vm_insnhelper.c (vm_call_method): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* safe.c (rb_secure): preserve encoding of the called method name
in error messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* safe.c (rb_insecure_operation): preserve encoding of the called
method name in error messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (check_exec_redirect_fd, check_exec_redirect),
(rb_execarg_addopt): get rid of inadvertent ID pindown.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_setter): preserve encoding of global variable
name in error message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c (rb_insn_operand_intern): preserve encoding of method
name in CALL_INFO at disassembling.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (must_respond_to): preserve encodings of variable name and
class name in warning message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ripper/dummyparser.rb (on_rescue): add to turn exception
class list into NodeList, to test exception class list.
* test/ripper/test_parser_events.rb (test_rescue_class): add
missing test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Thanks Vit Ondruch for the patch! [ruby-core:65836]
* test/resolv/test_dns.rb: test for patch
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* object.c (rb_mod_const_get, rb_mod_const_defined): ditto.
* variable.c (rb_const_missing, rb_mod_const_missing): call
const_missing without new ID to get rid of inadvertent ID
creation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/matrix/test_vector.rb (test_independent): fix exception
class path, Vector does not have its own TypeError. [#10451]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (symbol_list): fix the node type of literal symbol list
with no interpolation. [ruby-core:66343]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_exception.rb (test_name_error_info): add missing
test of NoMethodError and NameError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/-ext-/symbol/test_inadvertent_creation.rb: split
test_module_const_defined? from test_module_const_get, and
assertion for the latter.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* object.c (check_setter_id): show the original argument instead
of nil on TypeError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c (proc_binding): use the original iseq on a binding from
proc from method object to get the location.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c (rb_current_receiver): new function to return the
receiver in the current control frame. [Feature #10195]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Unnecessary since r47422 when the "rescue IOError" clause
was removed.
* test/ruby/test_io.rb (test_readpartial_locktmp):
remove unnecessary begin/end
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(REXMLTests::TestDocument::EntityExpansionLimitTest):
Group tests by general entity and parameter entity.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(REXMLTests::TestDocument::EntityExpansionLimitTest): Define
test XML in each test method because (1) each XML in used only
one test and (2) related data and code should be close.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(REXMLTests::TestDocument::EntityExpansionLimitTest):
Use one test method for one test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(REXMLTests::TestDocument::EntityExpansionLimitTest): Use
setup and teardown instead of ensure in test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Fix wrong parent class. It doesn't need inherit tests in
TestDocument class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
reported by Tomas Hoger <thoger@redhat.com> and patched by nahi.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/test_unicode_normalize.rb (setup): skip only once, and
silently ignore other tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/test_unicode_normalize.rb (read_tests): do nothing if the
test data file is not found.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
remove useless sort. show_files will sort the result and
another branch, files_in_gem, doesn't sort.
it should be removed for consistency.
* test/rubygems/test_gem_commands_contents_command.rb
(test_execute_default_gem): adjust the sort algorithm with
Gem::Commands::ContentsCommand#show_files, which sort items
as array of [prefix, basename] not strings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
exceptions on server thread.
Delete read_timeout method call to fix NoMethodError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
function to support nonblock-mode of pipes.
* win32/win32.c (rb_w32_read): nonblock-mode pipe returns ERROR_NO_DATA
if there is no data, but also returns it if remote-end is closed.
* win32/win32.c (rb_w32_write): if cannot to write any data, it may be
blocking.
* io.c (rb_io_set_nonblock): use rb_w32_set_nonblock for Windows.
* ext/io/nonblock/nonblock.c (rb_io_nonblock_set): use ruby's API when
setting nonblock-mode.
* test/ruby/test_io.rb: test nonblock pipes on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* template/unicode_norm_gen.tmpl (UnicodeNormalize): embed the
version of Unicode data files used to generate.
* test/test_unicode_normalize.rb (TestUnicodeNormalize): use the
embedded version to load the test data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to avoid race condition.
(cleanup_shutdown_pipe): New private method.
(cleanup_listener): Extracted from shutdown method.
Call this method from start method to avoid race condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/-ext-/proc/test_bmethod.rb (test_super_in_bmethod): block
in bmethod test for [Feature #10195].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/-ext-/proc/test_bmethod.rb (test_super_in_bmethod): super
in bmethod test for [Feature #10195].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_exception.rb: more tests for catch and throw.
catch but no throw, autogenerated tag, and uncaught throw.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/rubygems/test_gem_remote_fetcher.rb (RemoteFetcherCleanup):
close all pooled connections for each tests to fix leaked file
descriptors.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
as much as possible.
* test/openssl/test_ssl_session.rb: Ditto.
* test/openssl/test_partial_record_read.rb: Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
pipe to stop server instead of shutdown/close a listening socket.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parse_atmark): mere atmark and two atmarks without
succeeding identifiers are invalid as instance/class variable
names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/digest/lib/digest.rb (Digest()): This function should now be
thread-safe. If you have a problem with regard to on-demand
loading under a multi-threaded environment, preload "digest/*"
modules on boot or use this method instead of directly
referencing Digest::*. [Bug #9494]
cf. https://github.com/aws/aws-sdk-ruby/issues/525
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/test_time.rb (TestTimeExtension#test_iso8601): run all
xmlschema tests with iso8601 method, and fix the test name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c (vm_callee_setup_arg{_complex,}): try conversion
by to_ary for a lambda, as well as a proc.
[ruby-core:65887] [Bug #9605]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (block_param_def): reset current_arg after block
parameter definition, not to warn references in that block body.
[ruby-core:65990] [Bug #10314]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* load.c (rb_f_load): path name needs to be transcoded to OS path
encoding. [ruby-list:49994]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c (process_options, load_file_internal2): should not
require other files when dump option is given.
[ruby-dev:48712] [Bug #10435]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
reported by Willis Vandevanter <will@silentrobots.com> and
patched by nahi.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c (method_proc): the receiver of binding from method should
be same as the receiver of the method.
[ruby-core:65917] [Bug #10432]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ripper/test_parser_events.rb (test_binary): split for each
operators.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
reduce garbage during forks
This seems to reduce failures on my memory-constrained VM
when doing a full test-all.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/rake/cpu_counter.rb (count): prefer Etc.nprocessors, which
is hundreds times faster.
* test/rake/test_rake_cpu_counter.rb: add tests for features, and
remove useless tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_yylex): dispatch newline and space at fluent
interface, so that the following identifier does not include the
space. [ruby-dev:48684] [Bug #10411]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_object.rb: assertion for r48118. defined method
should be called. [Bug #10421]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (rb_hash_delete): now does not call the block given to
the current method. [ruby-core:65861] [Bug #10413]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c (rb_method_entry_make): warn redefinition only for
already defined methods, but not for undefined methods.
[ruby-dev:48691] [Bug #10421]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
bug that can't parse XML correctly when
Encoding.default_internal is different with XML
encoding. REXML::Source converts XML encoding on read. So IO
should not convert XML encoding.
Based on patch by NAKAMURA Usaku.
[ruby-dev:48686] [Bug #10418]
* test/rexml/test_encoding.rb
(REXMLTests::EncodingTester#test_parse_utf16_with_utf8_default_internal):
Add the for the above case.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(REXMLTests::EncodingTester#test_parse_utf16): Use meaningful
test name. "ticket" in the old test name means the ticket in
REXML's issue tracker. The REXML's issue tracker was gone. So
"ticket" is meaningless.
* test/rexml/data/ticket_110_utf16.xml: Rename to ...
* test/rexml/data/utf16.xml: ... this.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(REXMLTests::EncodingTester#test_ticket_110): Fix expected and
actual order.
Patch by NAKAMURA Usaku. Thanks!!!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Occasionally I get timeout errors during this test on an
overloaded system, so we may need to increase timeouts anyways.
For now, avoid the overhead of thread creation for every read we
do.
* test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
use IO#wait_readable instead of timeout
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* class.c (unknown_keyword_error): delete expected keywords
directly from raw table, so that the given block is not called.
[ruby-core:65837] [Bug #10413]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_module.rb (test_uninitialized_instance_variable):
test with UTF-8 default external encoding for non-locale
environments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* re.c (unescape_nonascii): make dynamically compiled US-ASCII
regexps ASCII-8BIT encoding if binary (hexadecimal, control,
meta) escapes are contained, as well as literal regexps.
[ruby-dev:48626] [Bug #10382]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The current implementation currently delivers signals to self
immediately and synchronously, so we do not need explicit,
potentially-confusing sleeps to wait for signal delivery.
* test/-ext-/bug_reporter/test_bug_reporter.rb
(test_bug_reporter_add): revert r47972
* test/ruby/test_rubyoptions.rb (test_segv_test): revert r47971
[ruby-core:65764]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Signal delivery is not immediate, so wait for signal delivery.
* test/-ext-/bug_reporter/test_bug_reporter.rb
(test_bug_reporter_add): fix race
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Signal delivery is not guaranteed to be immediate, a process may
exit before receiving signal it sent itself.
* test/ruby/test_rubyoptions.rb (test_segv_test): fix race
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
We must capture intended target PID before forking, since
Process.ppid may change if parent dies (e.g. due to timeout)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
assert_regexp_list.
Show multiline string in multi lines.
* test/-ext-/bug_reporter/test_bug_reporter.rb: Use
assert_pattern_list.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enum.c (enum_inject): return nil if no iteration, instead of
Qundef.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_optimization.rb (test_string_eq_neq): new test
(test_string_ltlt): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_optimization.rb (test_string_freeze): new test
(test_hash_aref_with): ditto
(test_hash_aset_with): ditto
Our new (in 2.2) optimizations must not trigger when redefined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
descending order.
[ruby-core:65452] Suggested by David Grayson.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (remove_duplicate_keys): should not simply eliminate all
value nodes, which may have side effects.
[ruby-core:65625] [Bug #10315]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (assocs): concatenate splatted literal hashes. the
former key has precedence even if duplicated literal keys
follow. [ruby-core:65368] [Bug #10315]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The st_foreach and st_foreach_check functions support transitioning
from a packed to an unpacked state during iteration. However, this
functionality did not get exercised by the current test suite until
now. This should help us prevent breakage when making modifications
to st.
* ext/-test-/st/foreach/extconf.rb: new file
* ext/-test-/st/foreach/foreach.c: ditto
* test/-ext-/st/test_foreach.rb: ditto
[Feature #10321]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c (rb_f_kill): get rid of deadlock as unhandled and
discarded signals do not make interrupt_cond signaled.
based on the patch by Kazuki Tsujimoto at [ruby-dev:48606].
[Bug #9820]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c (rb_f_kill): should not ignore signal unless the
default handler is registered. [ruby-dev:48592] [Bug #9820]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_string.rb (test_LSHIFT_neary_long_max): enable
only on platforms where string size range is smaller than memory
space. this test does not make sense but just wastes memory and
time on other platforms, as it is hardly possible that a string
size becomes neary LONG_MAX if long size equals pointer size.
[ruby-core:65410] [Bug #10325]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/rubygems/test_gem_source_git.rb (test_rev_parse): dispose
error message by git, which should be intended.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
with tmpfs and old linux kernel. [ruby-core:65355][Bug #10313]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_data_type): separate ripper data type for from
parser.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
uri doesn't respond to #to_str. [ruby-core:64453] [Bug #10150]
* test/uri/test_parser.rb: test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/digest/digest.c (rb_digest_base_alloc): use typed data.
* ext/digest/digest.c (rb_digest_base_copy): fail unless original
object has same algorithm.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e