summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-12-13bigdecimal: version 1.3.3mrkn
Import bigdecimal version 1.3.3. The full commit log is here: https://github.com/ruby/bigdecimal/compare/v1.3.2...v1.3.3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13test/ruby/test_env.rb: suppress a warningnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13test_process.rb: fix error when empty groupsnobu
* test/ruby/test_process.rb (test_maxgroups): set one element at least get rid of ZeroDivisionError when no process groups. [ruby-core:84224] [Bug #14174] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13Avoid extra output in test_thread_interrupt_for_killed_threaderegon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13webrick: compile RE correctly for beginning and end matchnormal
Using ^ and $ in regexps means we can accidentally get fooled by "%0a" in HTTP request paths being decoded to newline characters. Use \A and \z to match beginning and end-of-string respectively, instead. Thanks to mame and hsbt for reporting. * lib/webrick/httpserver.rb (MountTable#compile): use \A and \z instead of ^ and $ * lib/webrick/httpserver.rb (MountTable#normalize): use \z instead of $ * test/webrick/test_httpserver.rb (test_cntrl_in_path): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Capture the values of globals in EnvUtil to restore to the originaleregon
* Avoids the thread-safety issues mentioned in r61192, when thread concurrently modify default Encodings or $VERBOSE. Their state will always be the original one once the test finishes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Revert r61192 and r61193eregon
* More general fix coming. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Use EnvUtil.with_default_external in tests needing iteregon
* Reverts part of r54522. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Do not change Encoding.default_internal in assert_raise_with_messageeregon
* It is not thread-safe: if two threads call it concurrently, the default_internal Encoding might not be restored, which causes many problems. The same applies for $VERBOSE, which might also not be restored to its original value but to the new value instead. This happens because reading the original value might capture the value already changed by EnvUtil.with_default_internal in another Thread. One solution could be to capture the value of these globals before running the test. * Reverts part of r54522. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Check that global encodings are not changed in test-alleregon
* Check that Encoding.default_internal and Encoding.default_external are the same before and after every test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Remove useless assertion in TestThread#test_handle_interrupt_blockingeregon
* It was originally th.join(0.2), but th.join never returns nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Handle exception explicitly in TestBignum#test_interrupt_during_to_seregon
* Otherwise it produces a warning with Thread.report_on_exception=true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Fix test-all tests to avoid creating report_on_exception warningseregon
* The warnings are shown by Thread.report_on_exception defaulting to true. [Feature #14143] [ruby-core:83979] * Improves tests by narrowing down the scope where an exception is expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Remove extra assert_nil in Rinda testseregon
* They are never executed since thread_join() raises. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Fix tests which fail with extra stderr output when a Thread dieseregon
* [Feature #14143] [ruby-core:83979]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Rescue expected Interrupt in TupleSpaceTestModule#test_take_bug_8215eregon
* test/rinda/test_rinda.rb (test_take_bug_8215): add rescue for expected exception, which removes the warning by Thread.report_on_exception [Feature #14143]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Set Thread.report_on_exception=true by default to report exceptions in Threadseregon
* [Feature #14143] [ruby-core:83979] * vm.c (vm_init2): Set Thread.report_on_exception to true. * thread.c (thread_start_func_2): Add indication the message is caused by report_on_exception = true. * spec/ruby: Specify the new behavior. * test/ruby/test_thread.rb: Adapt and improve tests for Thread.report_on_exception and Thread#report_on_exception. * test/ruby/test_thread.rb, test/ruby/test_exception.rb: Unset report_on_exception for tests expecting no extra output. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12struct.c: show `keyword_init: true` on inspectk0kubun
for debugging if it's specified for the Struct class. This follows up r61137. We don't provide a method to check it because I don't think of any use case, but showing this to inspect would be helpful for debugging if someone is debugging whether keyword_init is properly enabled or not. In this commit, I didn't show `keyword_init: false` because of backward compatibility. Ideally any application should not depend on the behavior of inspect, but I don't have strong motivation to break it too. [close GH-1773] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12irb/test_init.rb: add test to ensure $0k0kubun
is not changed. At first `ARGV.unshift('something')` was suggested for r61149, but it wasn't sufficient because it modifies $0. Not only to preserve ARGV, but also r61149 intends to preserve $0. This test prevents future breakage of the behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12test_struct.rb: rename constants to clarifyk0kubun
the intention. Follows up r61137. They were forgotten to be renamed when :keyword_args is renamed to :keyword_init. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12ext/coverage/coverage.c: Add test casesyui-knk
* ext/coverage/coverage.c (test_method_coverage_for_define_method): Add test cases for method coverages which test do-end block define_method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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