summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-05-29test/erb/test_erb.rb: Fix unused variable warningk0kubun
ruby/test/erb/test_erb.rb:575: warning: assigned but unused variable - foo git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28test/ruby/test_io.rb: adjust CPU usage check to 10%normal
I miscalculated for r58934, since we sleep 100ms, and the worst possible case is 100 Hz in the kernel meaning we only have 10ms resolution. So, we need to increase our CPU percentage to >= 10% for this. This should be more than enough for our CI machines which have 300 Hz kernels [ruby-core:81429]: http://ci.rvm.jp/results/trunk-test@sasada-8core/1495942555 * test/ruby/test_io.rb (test_copy_stream_no_busy_wait): override default percentage git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28tests: increase CPU percentage threshold for assert_cpu_usage_lownormal
When sleeping for the tick rate of 100ms (defined in thread_pthread.c) as we do in test/ruby/test_io.rb (test_copy_stream_no_busy_wait), it may not be possible to measure with <= 10ms resolution on 100HZ systems (CONFIG_HZ in the Linux kernel). So increase the threshold to 15ms (10ms + 5ms slack for slow systems). * test/lib/test/unit/assertions.rb (assert_cpu_usage_low): increase pct default value [ruby-core:81427] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27rb_wait_for_single_fd: do not OOM or segfault with invalid FD on select()normal
Instead, match the poll() implementation used on Linux for now; as the Linux poll(2) manpage describes using negative FD to easily ignore an FD in a larger FD set while (sleeping the given timeout). I'm not entirely sure if matching poll() behavior is a good idea for a single FD, but it's better than segfaulting or NoMemoryError. * thread.c (init_set_fd): ignore negative FD * test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb (test_wait_for_invalid_fd): check values which may trigger segfaults or OOM git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27test for IO.copy_stream CPU usage (r58534)normal
I'm likely to make similar mistakes in the future when working on Fiber auto-scheduling. Start adding assertions for existing code, first. * test/ruby/test_io.rb (test_copy_stream_no_busy_wait): added * test/lib/test/unit/assertions.rb (assert_cpu_usage_low): added git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27apply timeout scaleko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27numeric.c: fix for small numbernobu
* numeric.c (flo_floor, flo_ceil): should not return zero for small number. [ruby-core:81394] [Bug #13599] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-26dir.c: yield without base partnobu
* dir.c (glob_helper): yield globbed part only without the base directory path part if the base is given. [Feature#13056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-25use timeout scale.ko1
* test/lib/envutil.rb: introduce EnvUtil.apply_timeout_scale to use this scale from outside. * test/ruby/test_thread.rb (test_fork_in_thread): respect timeout scale. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-25erb.rb: Add ERB#result_with_hashk0kubun
[ruby-core:55985] [Feature #8631] [fix GH-1623] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-25Raise ArgumentError if sprintf format string ends with %eregon
* Add tests and specs. See ruby/spec#401. Patch by Yuta Iwama and Shintaro Morikawa. [ruby-core:80153] [Bug #13315] [Fix GH-1560] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-25dir.c: Dir.each_child and Dir.childrennobu
* dir.c (dir_s_each_child, dir_s_children): Dir.each_child and Dir.children which are similar to Dir.foreach and Dir.entries respectively, except to exclude "." and "..". [Feature #11302] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-25test_dir.rb: test Dir.entriesnobu
* test/ruby/test_dir.rb (test_entries): test class singleton method Dir.entries too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-24string.c: fix String#crypt leak introduced in r58866normal
* string.c (rb_str_crypt): define LARGE_CRYPT_DATA when allocating git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-24test_http.rb: fix r58855nobu
* test/net/http/test_http.rb (test_s_start): git rid of error when failed to start a connection. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-24enum.c: respect method visibilitynobu
* enum.c (ary_inject_op): should respect method visibility, do not optimize uncallable method. [ruby-core:81349] [Bug #13592] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-24test_enum.rb: test_inject_array_op_redefinednobu
* test/ruby/test_enum.rb (test_inject_array_op_redefined): test other operators too. [Bug#12178] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-24assertions.rb: AllFailures#foreachnobu
* test/lib/test/unit/assertions.rb (AllFailures#foreach): shortcircuit for `each` and `AllFailures#for`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-24duplicate methodnobu
* test/ruby/test_enum.rb (assert_float_equal): remove overridden definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-23skip on Solaris 11naruse
On Solaris 11, MSG_OOB is in readfds? http://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20170523T152403Z.fail.html.gz http://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20170523T152503Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-23Dir as base optionnobu
* dir.c (glob_helper): support Dir instance as `base` option. [Feature#13056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-23test_dir.rb: sortnobu
* test/ruby/test_dir.rb (test_glob_base): sort the globbed result to compare. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-23Dir.glob base optionnobu
* dir.c (dir_s_aref, dir_s_glob): add new optional keyword argument, `base`. [Feature#13056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-23fix FD leaksnobu
* test/net/http/test_http.rb (test_s_start): finish connections to get rid of FD leaks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-22lib/net/protocol.rb: account read_bytes before caller sees itnormal
Users may modify the chunk yielded to them in Net::HTTPResponse#read_body. This will allow users to reduce memory usage by calling String#clear on the buffer once they're done using it. * lib/net/protocol.rb (read): increment read_bytes earlier (read_all): ditto * test/net/http/test_httpresponse.rb (test_read_body_block_mod): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-22net/imap: separate @continuation_request_exception from @exceptionshugo
Otherwise literal data will be sent even if NO response is returned because @exception is set to nil in receive_responses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-21string.c: fix String#{casecmp,casecmp?} for non-string argumentsstomar
* string.c: make String#{casecmp,casecmp?} return nil for non-string arguments instead of raising a TypeError. * test/ruby/test_string.rb: add tests. Reported by Marcus Stollsteimer. Based on a patch by Shingo Morita. [ruby-core:80145] [Bug #13312] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-21test_string.rb,test_symbol.rb: add some testsstomar
* test/ruby/test_string.rb: add more test cases for String#casecmp. * test/ruby/test_symbol.rb: ditto for Symbol#{casecmp,casecmp?}. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20erb.rb: Allow trimming CR in all trim_modesk0kubun
to unify a behavior with r58823 and r58825. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20erb.rb: Allow explicit trimming carriage returnk0kubun
when trim_mode is "-", for Windows environments. [ruby-core:39625] [Bug #5339] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20erb.rb: Allow trimming carriage returnk0kubun
when trim_mode is "<>", for Windows environments. [Bug #11464] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20Clean proxynaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20prime.rb: remove alias after timeout teststomar
* test/test_prime.rb: remove alias after timeout test. * lib/prime.rb: fix typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20compile.c: fix catch-table labels optimizationnobu
* compile.c (remove_unreachable_chunk): do not eliminate chunks followed by labels in catch-table entries. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20lib/prime: Fix primality of some large integers [#13492].marcandre
* lib/prime.rb: Use accurate sqrt to insure all factors are tested. Patch by Marcus Stollsteimer. * test/test_prime.rb: Adapt test for timeout git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19fix off-by-one in r58806normal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19test/ruby/test_io.rb: new test for IO.select exception setnormal
Ensure this rarely-used feature of IO.select continues to work properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19Net::HTTP#start now pass :ENV to p_addr by default [Bug #13351]naruse
To avoid this, pass nil explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19Merge latest dtoa.c [Bug #13545]naruse
Apply some part of http://www.netlib.org/fp/dtoa.c with my eyes... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19Of course, opened file is not able to unlink on Windowsusa
* test/test_tempfile.rb (test_create_with_block): close the tempfile before unlink. fixed a failure on Windows introduced at r58791. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19net/imap: Net::IMAP#append should not block when NO response is receivedshugo
[ruby-dev:50129] [Bug#13579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19tempfile.rb: remove in Tempfile.createnobu
* lib/tempfile.rb (Tempfile.create): should not fail even if the temporary file has been removed in the block, just ignore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-18Fix strange indentationk0kubun
which I introduced at r58773. Hard tabs and spaces are mixed... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-17cgi/util.rb: Don't escape tilde in #escapek0kubun
to make it compatible with ERB::Util.url_encode. ext/cgi/escape/escape.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-17erb.rb: Don't encode tilde in #url_encodek0kubun
Based on patch by madeofcode (Mark Dodwell). [ruby-core:46168] [Bug #6696] [Fix GH-54] `~` is a unreserved character. https://tools.ietf.org/html/rfc3986#section-2.3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-17test_dir_m17n.rb: read in filesystem encodingnobu
* test/ruby/test_dir_m17n.rb (test_entries_compose): read in filesystem encoding instead of default external encoding on Windows too. these two encodings may differ on some environments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16Revert "test/test_extilibs.rb: do not check the existence of fiddle"normal
This reverts r58761 since fiddle is considered critical. [ruby-core:81201] [ruby-core:81203] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16test/test_extilibs.rb: do not check the existence of fiddlenormal
libffi is not installed on all systems, and is not needed for most of the tests. Tested on a fresh FreeBSD 11.0 VM git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16test/unit.rb: fix returning job tokensnobu
* test/lib/test/unit.rb (_run_parallel): flush job tokens after quitting workers when normally finished too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16test_process.rb: compare in UTF-8nobu
* test/ruby/test_process.rb (test_execopts_open_chdir_m17n_path): compare directory name in UTF-8. encoding of `Dir.pwd` is affected by filesystem encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e