aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* test/thread: relax internal implementation check in error messagenormal2017-05-092-2/+2
| | | | | | | | | | | | | | Queue, SizedQueue, and ConditionVariable internal implementation should not be tied to using arrays. Implementation details can change and I am working on a change to remove the dependency on arrays (as others may attempt, too) by using ccan/list for the waiter list. * test/thread/test_cv.rb (test_dump): remove check for Array * test/thread/test_queue.rb (test_dump): ditto [ruby-core:81001] [Misc #13541] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: brace after literal argnobu2017-05-091-0/+10
| | | | | | | | | | * parse.y (symbol, dsym, parser_set_number_literal, parser_yylex): set state to END too not only ENDARG and after a literal, so that a left brace after it should be a primary block bound to the literal, which causes syntax error. [ruby-core:81037] [Bug #13547] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: do after cmdarg in parennobu2017-05-091-0/+4
| | | | | | | | | * parse.y (parser_yylex): set state to ENDARG after a string literal, so that `do` after a literal should be `do_block` and bound to the outer method, as well as a numeric/symbol literal. [ruby-core:72482] [Bug #11873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_syntax.rb: test_brace_after_local_variablenobu2017-05-091-0/+9
| | | | | | | * test/ruby/test_syntax.rb (test_brace_after_local_variable): another test using braces. [Bug #11873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: cleanup waitq upon thread deathnormal2017-05-072-0/+25
| | | | | | | | | | | | | * variable.c (autoload_reset): use idempotent list_del_init (autoload_sleep): moved code from rb_autoload_load (autoload_sleep_done): cleanup for use with rb_ensure (rb_autoload_load): ensure list delete happens in case the thread dies during sleep * test/ruby/bug-13526.rb: new script for separate execution * test/ruby/test_autoload.rb (test_bug_13526): new test [ruby-core:81016] [Bug #13526] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make Integer#{round,floor,ceil,truncate} always return integerstomar2017-05-061-8/+20
| | | | | | | | | | | | | | | * numeric.c (int_round): return integer (self) instead of float for Integer#round with positive ndigits argument, because conversion to float introduces errors for large integers. * numeric.c (int_floor): ditto for Integer#floor. * numeric.c (int_ceil): ditto for Integer#ceil. * numeric.c (int_truncate): ditto for Integer#truncate. * test/ruby/test_integer.rb: adjust test cases and add some more. [ruby-core:80645] [Bug #13420] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ripper/lexer.rb: nested indented heredocnobu2017-05-062-0/+12
| | | | | | | | | * ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): insert stripped leading spaces as `on_ignored_sp` elements, so that the original source can be reconsructed. [ruby-core:80977] [Bug #13536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* share `@@accept_charset`nobu2017-05-061-0/+4
| | | | | | | | * lib/cgi/{core,util}.rb: include CGI::Util not only extending, to share `@@accept_charset` class variable, so that it is always accessible. [ruby-core:80986] [Bug #13539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: make shared string modifiablenobu2017-05-041-0/+10
| | | | | | | | * parse.y (dedent_string): ensure that the string is modifiable, not to set the length of shared string. [ruby-core:80987] [Bug #13540] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rss: Accept empty text element as valid elementkou2017-05-031-0/+24
| | | | | | | | | | | Parser has been accepted it but XML serializer wasn't accepted. Reported by stefano frabetti. Thanks!!! [ruby-core:80965] [Bug #13531] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ripper/lexer.rb: nested indented heredocnobu2017-05-021-0/+24
| | | | | | | | * ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): fix for nested indedented here documents, where `Elem`s are nested too. [ruby-core:80977] [Bug #13536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2017-05-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rubygems-2.6.12 from rubygems/rubygems.hsbt2017-05-015-7/+142
| | | | | | | | | | | | | | * Details of changes: https://github.com/rubygems/rubygems/blob/009080040279282d7b8ddd09acab41719cb4ba00/History.txt#L3 * I kept ko1's commmit related thread issue. It's not merged 2.6 branch on rubygems. https://github.com/ruby/ruby/commit/1721dfa0ea963a85d4ac1e3415eb18ef427d4d36 * I removed test_realworld_default_gem from rubygems-2.6.12. It fails on Ruby trunk. Because it's differences of test suite and environment. https://github.com/rubygems/rubygems/pull/1899 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* object.c: Kernel#yield_selfnobu2017-05-011-0/+8
| | | | | | | | * object.c (rb_obj_yield_self): new method which yields the receiver and returns the result. [ruby-core:46320] [Feature #6721] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* zlib.c: no buf_filled in zstreamnobu2017-05-011-0/+10
| | | | | | | | * ext/zlib/zlib.c (zstream): manage capacity and size of `buf` instead of size and separated member `buf_filled`. reported by Christian Jalio (jalio) at https://hackerone.com/reports/211958 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* node.h: sign-extendnobu2017-04-291-0/+10
| | | | | | | | | * node.h (nd_line): should sign-extend. shifting `VALUE` extends with zero bits if `sizeof(VALUE)` equals to `sizeof(int)`. the zero bits are truncated if `sizeof(VALUE)` is bigger enough. [ruby-core:80920] [Bug #13523] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix line in rescuenobu2017-04-281-0/+13
| | | | | | | * parse.y (set_line_body, primary): fix line number of bodystmt as the beginning of the block. [ruby-core:79388] [Bug #13181] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Send the backtrace of the circular require warning as a single String to ↵eregon2017-04-271-2/+2
| | | | | | | | | | | Warning.warn * load.c: send as a single string. * error.c: expose the string formatted by rb_warning as rb_warning_string(). * test/ruby/test_exception.rb: update tests. [ruby-core:80850] [Bug #13505] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refactor newhash (revision 58463 another try) [fix GH-1600]shyouhei2017-04-272-1/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * st.c (rb_hash_bulk_insert): new API to bulk insert entries into a hash. Given arguments are first inserted into the table at once, then reindexed. This is faster than inserting things using rb_hash_aset() one by one. This arrangement (rb_ prefixed function placed in st.c) is unavoidable because it both touches table internal and write barrier at once. * internal.h: delcare the new function. * hash.c (rb_hash_s_create): use the new function. * vm.c (core_hash_merge): ditto. * insns.def (newhash): ditto. * test/ruby/test_hash.rb: more coverage on hash creation. * test/ruby/test_literal.rb: ditto. ----------------------------------------------------------- benchmark results: minimum results in each 7 measurements. Execution time (sec) name before after loop_whileloop2 0.136 0.137 vm2_bighash* 1.249 0.623 Speedup ratio: compare with the result of `before' (greater is better) name after loop_whileloop2 0.996 vm2_bighash* 2.004 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: send as a single stringnobu2017-04-261-0/+4
| | | | | | | | * error.c (rb_warn_m): send the arguments as a single string concatenated with a newline, so it can be filtered easily. [ruby-core:80875] [Feature #12944] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* suppress_warningnaruse2017-04-251-3/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add timeout.ko12017-04-251-2/+11
| | | | | | | | | | * test/ruby/test_trace.rb (test_trace_stackoverflow): sometimes this test was stopped forever and killed by test process forcibly. However, this test only checks if this code cause some critical failure such as SEGV. So that we can add timeout for this code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* no longer rescue exceptions of #<=> when initializing a Rangeeregon2017-04-251-0/+8
| | | | | | | | | * range.c (range_init): no longer hide the user exception with a ArgumentError, just let the user exception go through. * test/ruby/test_range.rb (test_new): add tests. [Feature #7688] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* no longer rescue exceptions of #coerce in Integer#steperegon2017-04-252-3/+3
| | | | | | | | * numeric.c (num_step_negative_p): no more error hiding. * test/ruby/test_float.rb, test/ruby/test_numeric.rb: follow the change. [Feature #7688] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* no longer rescue exceptions in numeric comparison operationseregon2017-04-251-6/+4
| | | | | | | | * numeric.c (do_coerce): no more error hiding. * test/ruby/test_numeric.rb: follow the change. [Feature #7688] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Import gemspechsbt2017-04-251-0/+2
| | | | | | | | | | Import gemspec and test file from ruby/webrick. * webrick.gemspec: Update files and dependency for standalone gem. * test/webrick/utils.rb: Added explicitly loading of EnvUtil for test suite without ruby core test suite. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* load.c: backtrace of circular requirenobu2017-04-251-5/+29
| | | | | | | * load.c (load_lock): print backtrace of circular require via `Warning.warn` [ruby-core:80850] [Bug #13505] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Import gemspec and test file changes from ruby/gdbm.hsbt2017-04-251-0/+1
| | | | | | | | * gdbm.gemspec: Update basic configuraiton for standalone gdbm gem. * test/gdbm/test_gdbm.rb: In standalone environment, It needs to explicit loading of EnvUtil module for test suite. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: args tail at errornobu2017-04-241-0/+7
| | | | | | | | * parse.y (new_args_tail_gen): abandon parsing arguments after error. reported by ilsani Martino Sani (ilsani) at https://hackerone.com/reports/221201 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Allow Net::HTTP to fetch user/pass from http_proxynaruse2017-04-231-0/+17
| | | | | | | | Note that this feature is enabled only on environment variables are multi-user safe. In this time the list includes Linux, FreeBSD, or Darwin. [Bug #12921] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add diagnostic reports section header [ci skip]nobu2017-04-231-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* assert_syntax_error returns the exception [ci skip]nobu2017-04-231-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix space flag when Inf/NaN and width==3nobu2017-04-231-0/+52
| | | | | | | | * sprintf.c (rb_str_format): while `"% 2f"` and `"% 4f"` result in `" Inf"` and `" Inf"` respectively, `"% 3f"` results in `"Inf"` (no space). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/test_prime.rb: update method name in commentstomar2017-04-221-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_file_exhaustive.rb: check case-sensitive fsnobu2017-04-221-2/+4
| | | | | | | | * test/ruby/test_file_exhaustive.rb (test_expand_path): dump expanded file name, not only appended char, for case-sensitive filesystem. [ruby-dev:50093] [Bug #13489] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* define PACKED_STRUCT_UNALIGNED correctlynormal2017-04-221-0/+17
| | | | | | | | | | | | | | | | | | | Defining PACKED_STRUCT_UNALIGNED to a noop in ruby/config.h (via `configure') prevents the definition in include/ruby/defines.h from working This should have been fixed in r46914, so there's a size regression for some objects since Ruby 2.2+. I do not believe we can backport to existing releases, either, since it can affect ABI. Add a test for Time objects on common x86-based platforms to check for future regressions. * configure.in: remove PACKED_STRUCT_UNALIGNED definition * test/ruby/test_time.rb (test_memsize): new test for x86 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/socket/test_basicsocket: handle :wait_readable on read_nonblocknormal2017-04-211-0/+3
| | | | | | | | | | | On some systems with slower local sockets, :wait_readable may happen and we should wait on it to drain the socket. This is a possible fix for https://bugs.ruby-lang.org/issues/13491 * test/socket/test_basicsocket.rb (test_read_write_nonblock): handle :wait_readable on read_nonblock git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Removed mathn.rb from stdlib. It's deprecated from Ruby 2.2.hsbt2017-04-215-215/+0
| | | | | | [Feature #10169][[ruby-core:64553]] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_framework.rb: for case-sensitive filesystemnobu2017-04-211-2/+2
| | | | | | | | | | | * test/mkmf/test_framework.rb (test_single_framework): fix header file name for case-sensitive filesystem. it may not be same as the framework name, but should be the actual file name. [ruby-dev:50093] [Bug #13489] * test/mkmf/test_framework.rb (test_multi_frameworks): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use correct synchronization.ko12017-04-201-6/+6
| | | | | | | | * test/ruby/test_thread.rb (make_handle_interrupt_test_thread1): use Queue to use correct synchronization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby-lex.rb: fix continued line conditionsnobu2017-04-201-5/+5
| | | | | | | | * lib/irb/ruby-lex.rb (RubyLex#lex): fix conditions for continued line; empty lines, a semicolon, first line in `begin` block, just after `else` are not continued. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Removed deprecated extensions of mathn.hsbt2017-04-202-4/+0
| | | | | | | * ext/mathn/{complex,rational}: Removed from ruby core. [fix GH-1542][Feature #13334][ruby-core:80247] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Move test_extlibs.rb because it's not the test of ruby itselfusa2017-04-201-0/+0
| | | | | | | * test/test_extlibs.rb: moved from test/ruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* socket: avoid fcntl for read/write_nonblock on Linuxnormal2017-04-191-0/+50
| | | | | | | | | | | | | | | | | | | | | | On platforms where MSG_DONTWAIT works reliably on all sockets (so far, I know of Linux), we can avoid fcntl syscalls and implement IO#write_nonblock and IO#read_nonblock in terms of the socket-specific send and recv family of syscalls. This avoids side effects on the socket, and also encourages generic code to be written in cases where IO wrappers like OpenSSL::SSL::SSLSocket are used. Perhaps in the future, side-effect-free non-blocking I/O can be standard on all files and OSes: https://cr.yp.to/unix/nonblock.html * ext/socket/lib/socket.rb (read_nonblock, write_nonblock): Linux-specific wrapper without side effects [ruby-core:80780] [Feature #13362] * test/socket/test_basicsocket.rb (test_read_write_nonblock): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: wrong optimizationnobu2017-04-181-0/+43
| | | | | | | | * compile.c (compile_branch_condition): expression which has side effects should not be eliminated. [ruby-core:80740] [Bug #13444] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_optimization.rb: heredoc code stylenobu2017-04-181-36/+50
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* should not return.ko12017-04-171-1/+1
| | | | | | | | * test/ruby/test_settracefunc.rb (test_throwing_return_with_finish_frame): should not use `return`, but should use `next`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c: copy before cause setupnobu2017-04-171-0/+7
| | | | | | | * eval.c (setup_exception): copy frozen exception before setting up a cause not only a backtrace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_integer.rb: simplify teststomar2017-04-161-8/+5
| | | | | | * test/ruby/test_integer.rb: simplify test for Integer.sqrt. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_io.rb: use Thread.stop? to waitnobu2017-04-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e