summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-12-12Unneeded assertiona_matsuda
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add Method#=== that invokes #calla_matsuda
Patch by osyo via [Feature #14142] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add uplevel keyword to Kernel#warn and use itshyouhei
If uplevel keyword is given, the warning message is prepended with caller file and line information and the string "warning: ". The use of the uplevel keyword makes Kernel#warn format output similar to how rb_warn formats output. This patch modifies net/ftp and net/imap to use Kernel#warn instead of $stderr.puts or $stderr.printf, since they are used for printing warnings. This makes lib/cgi/core and tempfile use $stderr.puts instead of warn for debug logging, since they are used for debug printing and not for warning. This does not modify bundler, rubygems, or rdoc, as those are maintained outside of ruby and probably wish to remain backwards compatible with older ruby versions. rb_warn_m code is originally from nobu, but I've changed it so that it only includes the path and lineno from uplevel (not the method), and also prepends the string "warning: ", to make it more similar to rb_warn. From: Jeremy Evans code@jeremyevans.net Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12error.c(exc_full_message): Exception#full_messagesorah
Add a method to retrieve a String expression of an exception, formatted in the same way that Ruby prints an uncaught exception out. [Feature #14141] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12irb.rb: preserve ARGV on binding.irbk0kubun
This is not perfectly good solution (at least we don't want to have ARGV as default value of `argv` argument), but unfortunately IRB.setup and IRB.parse_opts are public methods and we can't make breaking change to those methods. We may deprecate using them and then make them private in the future, but the removal should not be in Ruby 2.5. So I kept their interface for now. [Bug #14162] [close GH-1770] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Integer#allbits?, Integer#anybits?, Integer#nobits? [Feature #12753]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12process.c: add Process.last_statusmrkn
* process.c (proc_s_last_status): add Process.last_status [ruby-core:83514] [Feature #14043] * test/ruby/test_process.rb (test_last_status): add a test case for Process.last_status. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12struct.c: add keyword_init option to Struct.newk0kubun
to initialize struct with keyword arguments. [Feature #11925] [close GH-1771] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add FrozenError as a subclass of RuntimeErrorshyouhei
FrozenError will be used instead of RuntimeError for exceptions raised when there is an attempt to modify a frozen object. The reason for this change is to differentiate exceptions related to frozen objects from generic exceptions such as those generated by Kernel#raise without an exception class. From: Jeremy Evans <code@jeremyevans.net> Signed-off-by: Urabe Shyouhei <shyouhei@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12ext/coverage/coverage.c: remove COVERAGE_EXPERIMENTAL_MODEmame
A NEWS entry is also added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11Fix a method nameyui-knk
* test/ruby/test_optimization.rb (test_fixnum_ge): Fix a method name to suppress method redefinition warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11remove vm_opt_binop_dispatch().ko1
* vm_insnhelper.c (vm_opt_binop_dispatch): removed because this function has several issues for micro-benchmark. Write conditions manually. The worst point is that we can't control value checking order. For example, we can assume FIXNUM arithmetic operations are most popular in Ruby, so that we need to check FIXNUM at first. * test/ruby/test_optimization.rb: also fix redef bug for LE/GT/GE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-10Add case equality arity to Enumerable#all?, any?, none? and one?,marcandre
and specialized Array#any? and Hash#any? Based on patch by D.E. Akers [#11286] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-09test_process.rb (test_maxgroups): add assertionsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-08test_file_exhaustive.rb: get rid of failuresnobu
* test/ruby/test_file_exhaustive.rb (test_utime_symlinkfile): under some condition, symlink file is also affected by utimes() on Linux. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-08test_file_exhaustive.rb: test_utime_symlinkfilenobu
* test_file_exhaustive.rb (test_utime_symlinkfile): investigate failures on some platforms. wait a second to tell if symlink atime is changed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-08test_file_exhaustive.rb: fix arguments ordernobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-06remove unnecessary read_timeout.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-06`Integer#pow(b)` accepts numerickazu
instead of integer only and returns numeric instead of integer only same as `Integer#**` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-05test_syntax.rb: Add a test case for `not()`yui-knk
* test/ruby/test_syntax.rb (TestSyntax#test_keyword_not_parens): Currently `not()` is tested by only TestRipper::ParserEvents#test_unary, so I think it's better to test this syntax directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-05ext/coverage/coverage.c: method coverage has column info. of method def.mame
This change makes method coverage result have not only first lineno of method defintion, but also code range (i.e. first lineno, first column, last lineno, and last column). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-05Revamp method coverage to support define_methodmame
Traditionally, method coverage measurement was implemented by inserting `trace2` instruction to the head of method iseq. So, it just measured methods defined by `def` keyword. This commit drastically changes the measuring mechanism of method coverage; at `RUBY_EVENT_CALL`, it keeps a hash from rb_method_entry_t* to runs (i.e., it counts the runs per method entry), and at `Coverage.result`, it creates the result hash by enumerating all `rb_method_entry_t*` objects (by `ObjectSpace.each_object`). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-05Remove unnecessary read_timeout.shugo
http://ci.rvm.jp/results/trunk-asserts-nopara@ruby-sky1/219867 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-04bignum.c, numeric.c: add Integer#pow(b, m)mrkn
This commit is based on the pull-request #1320 created by Makoto Kishimoto. [Feature #12508] [Feature #11003] [close GH-1320] * bignum.c (rb_int_powm): Added for Integer#pow(b, m). * internal.h (rb_int_powm): Declared to refer in numeric.c. * bignum.c (bary_powm_gmp): Added for Integer#pow(b, m) using GMP. * bignum.c (int_pow_tmp1): Added for implementing Integer#pow(b, m). * bignum.c (int_pow_tmp2, int_pow_tmp3): ditto. * internal.h (rb_num_positive_int_p): Moved from numeric.c for sharing the definition with bignum.c. * internal.h (rb_num_negative_int_p, rb_num_compare_with_zero): ditto. * numeric.c(negative_int_p): Moved to internal.h for sharing the definition with bignum.c. * numeric.c (positive_int_p, compare_with_zero): ditto. * numeric.c (rb_int_odd_p): Exported (renamed from int_odd_p). * internal.h (rb_int_odd_p): ditto. * internal.h (HALF_LONG_MSB): Added. * numeric.c (SQRT_LONG_MAX): Redefined by using HALF_LONG_MSB. * test/ruby/test_numeric.rb (test_pow): Added for Integer#pow(b, m). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-04revert r60999usa
* test/logger/test_logdevice.rb: revert r60999 because it was caused by not committed changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-03give a change to determine to rotate the log or notusa
* test/logger/test_logdevice.rb (test_shifting_{age,period_suffix}): give a chance to determine to rotate the log or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-03Add test for Bug::String.buf_newnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-02Modules should not have subclasses.shugo
When refining a module, the module was set to the superclass of its refinement, and a segmentation fault occurred. The superclass of the refinement should be an iclass of the module. [ruby-core:83617] [Bug #14070] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-02string.c: fix rb_external_str_new_with_encnobu
* string.c (rb_external_str_new_with_enc): do not search non-ascii by NULL pointer. [ruby-core:84055] [Bug #14150] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01Append "//" if empty host for file or postgres URInaruse
https://url.spec.whatwg.org/#url-serializing > Otherwise, if url’s host is null and url’s scheme is "file", append "//" to output. URL spec doesn't says anything about postgres, but assume the same thing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01Merge psych-3.0.0.hsbt
See NEWS file for this update details. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29Make Module#{define|alias|undef|remove}_method public [#14133]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29Make Module#attr{accessor|reader|writer|} public [#14132]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29test_workspace.rb: prefer using skipk0kubun
rather than ignoring test definition to know untestability when executing test with `-v`. Also this simplifies check using `MiniTest::Unit::Guard#windows?`. This change is suggested by @MSP-Greg here: https://github.com/ruby/ruby/commit/7128849c8c5fce8df450379db54136fd21fab6ad#commitcomment-25836745 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29file.c: File.lutimenobu
* file.c (utime_internal): add File.lutime. [Feature #4052] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29Unused module refinement shouldn't break method search.shugo
Use rb_callable_method_entry_t::defined_class instead of rb_callable_method_entry_t::owner, because the superclass of iclass should be searched for modules. [ruby-core:83613] [Bug #14068] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29strscan.c: add MatchData-like methodsnobu
* ext/strscan/strscan.c: added `size`, `captures` and `values_at` to StringScanner, shorthands of accessing the matched data. based on the patch by apeiros (Stefan Rusterholz) at [ruby-core:20412]. [Feature #836] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-28Merge rubygems-2.7.3.hsbt
http://blog.rubygems.org/2017/11/28/2.7.3-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-27Merge rdoc-6.0.0.beta4 from upstream.hsbt
It version applied `frozen_string_literal: true` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-27Merge psych-3.0.0.beta4 from upstream.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-27Ignore failures related to threading.ko1
* test/lib/tracepointchecker.rb: ignore "deletion trace" check when there are threads other than the main thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-26openssl: sync with 2475d94517b4rhe
Merge a commit from upstream: 01445af367ec test/test_ssl: prevent changing default internal encoding OpenSSL::TestSSL#test_fallback_scsv could change the default internal encoding accidentally, causing other unrelated test cases to fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-26leakchecker.rb: no conversionnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-25openssl: import v2.1.0.beta2rhe
Import Ruby/OpenSSL 2.1.0.beta2. The full commit log since commit e72d960db262 which was imported by r60013 can be found at: https://github.com/ruby/openssl/compare/e72d960db262...v2.1.0.beta2 ---------------------------------------------------------------- Kazuki Yamaguchi (26): bn: use ALLOCV() macro instead of xmalloc() appveyor.yml: remove 'openssl version' line test/test_ssl_session: skip tests for session_remove_cb x509ext: implement X509::Extension#== x509attr: implement X509::Attribute#== x509cert: implement X509::Certificate#== x509revoked: add missing X509::Revoked#to_der x509crl, x509revoked: implement X509::{CRL,Revoked}#== x509req: implement X509::Request#== ssl: extract rb_intern("call") cipher: disallow setting AAD for non-AEAD ciphers test/test_cipher: fix test_non_aead_cipher_set_auth_data failure ssl: fix conflict of options in SSLContext#set_params buffering: let #write accept multiple arguments pkey: make pkey_check_public_key() non-static x509cert, x509crl, x509req, ns_spki: check sanity of public key test/envutil: port assert_warning from Ruby trunk test/utils: remove a pointless .public_key call in issue_cert ssl: add SSLContext#add_certificate test/test_ssl: fix test_security_level Drop support for LibreSSL 2.4 kdf: add HKDF support test/test_x509cert: fix flaky test test/test_x509crl: fix random failure History.md: fix a typo Ruby/OpenSSL 2.1.0.beta2 Mark Wright (1): Fix build failure against OpenSSL 1.1 built with no-deprecated Thanks rhenium for the code review and fixes. Peter Karman (1): Add RSA sign_pss() and verify_pss() methods aeris (1): TLS Fallback Signaling Cipher Suite Value kazu (1): Use caller with length to reduce unused strings git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-25openssl: revert changes in SSLContext#{min,max}_version= in r60310rhe
And adapt a net/http test to their old behavior. [ruby-core:83491] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24test_workspace.rb: skip test failing on windowsk0kubun
> Note that all files are always readable > https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/chmod-wchmod It seems that we can't make a file unreadable with `File.chmod` on Windows. When file can't be read, File::EACCES is raised on Windows too. So r60900 should work anyway, but I don't know how to let it happen by Ruby code. I tried to open file before reading it, but I couldn't reproduce File::EACCES too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24Fix TOCTTOU and avoid to read existing unreadable filekazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24Fix typos [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24test/irb/test_workspace.rb: fix SCRIPT_LINES__nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e