aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* object.c: no TypeError at Symbolnobu2017-01-231-0/+4
| | | | | | | | * object.c (special_object_p): uninterned Symbol also should not raise a TypeError but return itself instead, as well as interned Symbols. [ruby-core:79216] [Bug #13145] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* csv.rb: fix field_size_limit checknobu2017-01-231-0/+22
| | | | | | | * lib/csv.rb (CSV#shift): the last column is an Array in extended column since r55985. [ruby-dev:49964] [Bug #13149] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/tempfile.rb: Specify frozen_string_literal: true.kazu2017-01-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* SecureRandom should try /dev/urandom first [Bug #9569]shyouhei2017-01-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * random.c (InitVM_Random): rename Random.raw_seed to Random.urandom. A quick search seems there are no practical use of this method than securerandom.rb so I think it's OK to rename but if there are users of it, this hunk is subject to revert. * test/ruby/test_rand.rb (TestRand#test_urandom): test for it. * lib/securerandom.rb (SecureRandom.gen_random): Prefer OS- provided CSPRNG if available. Otherwise falls back to OpenSSL. Current preference is: 1. CSPRNG routine that the OS has; one of - getrandom(2), - arc4random(3), or - CryptGenRandom() 2. /dev/urandom device 3. OpenSSL's RAND_bytes(3) If none of above random number generators are available, you cannot use this module. An exception is raised that case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: rescue/else/ensure in do-endnobu2017-01-191-0/+67
| | | | | | | * parse.y (do_body): allow rescue/else/ensure inside do/end blocks. [Feature #12906] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: rindex(//) should set $~.shugo2017-01-191-0/+3
| | | | | | This seems a bug introduced by r520 (1.4.0). [ruby-core:79110] [Bug #13135] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: chomp by -lnobu2017-01-191-1/+2
| | | | | | | * parse.y (rb_parser_while_loop): should chomp but not chop by -l option. [ruby-core:78099] [Bug #12926] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c: resolve refined method to undefnobu2017-01-181-0/+19
| | | | | | | * vm_method.c (rb_undef): resolve the method entry which refines a prepended method entry. [ruby-core:78944] [Bug #13096] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* class.c: non-keyword hash classnobu2017-01-181-0/+12
| | | | | | | * class.c (rb_extract_keywords): keep the class of non-keyword elements hash as the original. [ruby-core:77813] [Bug #12884] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* uri/generic.rb: fix exception on non-IP formatnobu2017-01-171-0/+25
| | | | | | | * lib/uri/generic.rb (URI::Generic#find_proxy): match IP address no_proxy against resolved self IP address. [Fix GH-1513] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/pstore.rb: Specify frozen_string_literal: true.kazu2017-01-172-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix a typo [ci skip]kazu2017-01-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_rational.rb: messagesnobu2017-01-161-93/+93
| | | | | | | * test/ruby/test_rational.rb (test_parse): add messages to assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r57323nobu2017-01-143-23/+22
| | | | | | | | StringIO.new makes the buffer IO.default_external, while StringIO.new("".dup) makes source encoding which is defaulted to UTF-8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Made #decode_rdata client to catch errorsnobu2017-01-141-0/+15
| | | | | | | | | | | * lib/resolv.rb (Resolv::DNS::Message::MessageDecoder#get_rr): re-raise an exception from decode_rdata as DecodeError, so it can report them to the top in more informative way. It was not reflecting on errors of data and thus breaking. Client code expects `DecodeError` and knows how to handle broken messages. [Fix GH-1511] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* StringIO.new makes a RW buffernobu2017-01-143-22/+23
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/observer.rb: Specify frozen_string_literal: true.kazu2017-01-131-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: movednobu2017-01-131-1/+1
| | | | | | | * error.c (preface_dump, postscript_dump): CrashReporter directory was used before Mac OS X 10.6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: movednobu2017-01-131-0/+5
| | | | | | | | * error.c (preface_dump, postscript_dump): moved from rb_vm_bugreport to place the last important message at the very last after [NOTE]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/smtp.rb: Specify frozen_string_literal: true.kazu2017-01-123-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* immediate message mode of compile errornobu2017-01-121-0/+4
| | | | | | | | | | | | | | * compile.c (append_compile_error): set Qtrue for erred state with showing the message immediately. * iseq.c (prepare_iseq_build): make immediate message mode if main or top level context, not to show the failed path twice in the first line. * iseq.c (cleanup_iseq_build): raise default message exception if immediate message mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/protocol.rb: preserve backtrace informationshugo2017-01-121-0/+22
| | | | | | | | BufferedIO#rbuf_fill should preserve backtrace information when raising EOFError. Otherwise, users get confused when EOFError is leaked out from Net::SMTP etc. [ruby-core:78550] [Bug #13018] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/rinda/test_rinda: skip multicast tests for unsupported systemsnormal2017-01-111-2/+13
| | | | | | | | This allows "test-all" to pass on systems without multicast support. I leave CONFIG_IP_MULTICAST unset in my Linux kernel .config, nowadays. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/fiddle/helper: remove special case for x86_64-linuxnormal2017-01-111-3/+0
| | | | | | | | | | | | | RUBY_PLATFORM is "x86_64-linux" on a 32-bit (x86) Ruby built and running on a 64-bit Linux kernel. I also have a /lib64 directory nowadays because I just installed multi-arch support in userspace. So, fall back to loading based in the size of a packed "unsigned long" type instead of special-casing. Tested with both x86 and x86_64 userspace on 64-bit Linux kernel, as well as x86 with a 32-bit Linux kernel. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/protocol.rb: Specify frozen_string_literal: true.kazu2017-01-111-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: replacement and blocknobu2017-01-111-0/+2
| | | | | | | * string.c (rb_enc_str_scrub): only one of replacement and block is allowed. [ruby-core:79038] [Bug #13119] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: yield invalid partnobu2017-01-111-3/+3
| | | | | | | * string.c (rb_enc_str_scrub): yield the invalid part only with ASCII-incompatible. [ruby-core:79039] [Bug #13120] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: block for scrub with ASCII-incompatiblenobu2017-01-111-0/+5
| | | | | | | * string.c (rb_enc_str_scrub): honor the given block with ASCII-incompatible encoding. [ruby-core:79039] [Bug #13120] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: check compilenobu2017-01-101-0/+17
| | | | | | | * compile.c (iseq_compile_each): check if sub nodes succeeded. [ruby-core:76531] [Bug #12613] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/pop.rb: Specify frozen_string_literal: true.kazu2017-01-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io_console.rb: fix of old CentOS5nobu2017-01-081-2/+2
| | | | | | | * test/io/console/test_io_console.rb (test_winsize): on old CentOS5 window size seems unable to be set across a pty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: unpaired sizenobu2017-01-071-0/+1
| | | | | | | * ext/io/console/console.c (console_set_winsize): reject unpaired pixel size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: OOB accessnobu2017-01-071-0/+30
| | | | | | | * ext/io/console/console.c (console_set_winsize): fix out-of-bounds access. [ruby-core:79004] [Bug #13112] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix optimization for hash aset/aref with fstringeregon2017-01-071-0/+13
| | | | | | | | | | | Patch by Eric Wong [ruby-core:78797]. I don't like the idea of making insns.def any bigger to support a corner case, and "test_hash_aref_fstring_identity" shows how contrived this is. [ruby-core:78783] [Bug #12855] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/fileutils.rb: Specify frozen_string_literal: true.kazu2017-01-077-7/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io.rb: squiggly heredocnobu2017-01-061-2/+3
| | | | | | | * test/ruby/test_io.rb (test_threaded_flush): use squiggly here document to strip leading spaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/delegate.rb: Specify frozen_string_literal: true.kazu2017-01-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/cmath.rb: Specify frozen_string_literal: true.kazu2017-01-041-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* adjust indent [ci skip]nobu2017-01-041-57/+62
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add `full` option to `ObjectSpace.dump_all`tenderlove2017-01-031-0/+13
| | | | | | | | | | | | | | | | | | | The `full` option includes all slots (even `T_NONE`) in the JSON output. This is to help with debugging heap fragmentation. Here is an example usage: ```ruby File.open('heap.json', 'w') do |f| ObjectSpace.dump_all(output: f, full: true) end ``` The `heap.json` file contains all slots, including empty slots. [Feature #13001] [ruby-core:78468] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/benchmark.rb: Specify frozen_string_literal: true.kazu2017-01-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test for [Feature #11547]nobu2017-01-011-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* passed block should keep the lambda-nessnobu2017-01-011-0/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c: fix return in lambdanobu2016-12-311-0/+20
| | | | | | | | | * vm.c (invoke_block_from_c_splattable): pass lambda-ness. * vm_eval.c (yield_under): invoke lambda proc properly. [ruby-core:78917] [Bug #13090] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c: memory leak in gcdnobu2016-12-301-0/+10
| | | | | | | | * rational.c (rb_gcd_gmp): fix memory leak. patched by KISHIMOTO, Makoto <ksmakoto AT dd.iij4u.or.jp> in [ruby-dev:49934]. [Bug #13089] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_pack.rb: fix test case added by r57187rhe2016-12-291-1/+1
| | | | | | | | | | | | The test case for String#unpack added by r57187 is not properly testing because the String will be filled after the block invocation. [ruby-core:78841] [Bug #13075] Thanks to nagachika for pointing this out: http://d.hatena.ne.jp/nagachika/20161226/ruby_trunk_changes_57184_57194#r57187 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c: fix for mathnnobu2016-12-291-0/+9
| | | | | | | * rational.c (read_num, read_rat_nos): dispatch by the type of numerator, for mathn. [ruby-core:78893] [Bug #13084] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: reduce fdivnobu2016-12-281-0/+7
| | | | | | | * numeric.c (rb_int_fdiv_double): reduce first for more precise result. [ruby-core:78886] [Bug #13078] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: ARGF fd leaknobu2016-12-271-1/+7
| | | | | | | * io.c (argf_next_argv): fix leak of fd after breaking in #each method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: fix race between read and closenobu2016-12-261-0/+30
| | | | | | | | * io.c (io_fillbuf): fix race between read and close, in the case the IO gets closed before the reading thread achieve the lock. [ruby-core:78845] [Bug #13076] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e