aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
Commit message (Collapse)AuthorAgeFilesLines
* fiber: fix machine stack marking when FIBER_USE_NATIVE is 0normal2017-09-081-0/+11
| | | | | | | | | | | | * cont.c (cont_mark): mark Fiber machine stack correctly when FIBER_USE_NATIVE is 0 * test/ruby/test_fiber.rb (test_mark_fiber): new test [Bug #13875] [ruby-core:82681] This bug appears to be introduced with r59557. ("refactoring Fiber status") git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: fix false coderangenobu2017-09-061-7/+20
| | | | | | | | * string.c (rb_enc_str_scrub): enc can differ from the actual encoding of the string, the cached coderange is useless then. [ruby-core:82674] [Bug #13874] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: grapheme clusters on frozen stringnobu2017-09-041-0/+2
| | | | | | | * string.c (rb_str_enumerate_grapheme_clusters): enumerate on shared frozen string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: enumerator_wantarraynobu2017-09-031-4/+35
| | | | | | | * string.c (enumerator_wantarray): show warnings at method functions for proper method names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: fix for non-Unicode encodingsnobu2017-09-031-0/+2
| | | | | | | * string.c (rb_str_enumerate_grapheme_clusters): should enumerate chars for non-Unicode encodings. [Feature #13780] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io.rb: suppress a warningnobu2017-09-031-1/+1
| | | | | | | * test/ruby/test_io.rb (test_single_exception_on_close): suppress ambiguous first argument warning with RUBYOPT=-w. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c: fix root fiber to_snobu2017-09-021-0/+1
| | | | | | | * cont.c (fiber_to_s): fix Fiber#to_s on root fibers which have no procs. [ruby-core:82629] [Bug #13859] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* skip unless PLATFORM is darwin.ko12017-09-011-4/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix C level backtrace on Darwinnaruse2017-09-011-0/+20
| | | | | | SEGV caused by invalid instruction call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: ensure after toplevel returnnobu2017-09-011-1/+1
| | | | | | | * compile.c (iseq_compile_each0): toplevel returns should fire ensures. [ruby-core:82492] [Bug #13844] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Skip test_open_tempfile_path on EINVALsorah2017-08-311-5/+11
| | | | | | | | | | Looks like File::Constants::TMPFILE could be defined even when not supported on system. Just skip the test when we get EINVAL on open(2). * test/ruby/test_file.rb(test_open_tempfile_path): Skip when EINVAL occured on File.open. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* File#path: Raise IOError when a file is O_TMPFILEsorah2017-08-311-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | File#path for a file opened with O_TMPFILE has no meaning. A filepath returned by this method isn't guarranteed about its accuracy, but files opened with O_TMPFILE are known its recorded path has no meaning. So let them not to return any pathname. After a discussion in ruby-core, just returning Qnil makes guessing the root cause difficult. Instead, this patch makes the method to raise an error. Other consideration is calling fnctl(2) on rb_file_path, but it adds a overhead, and it's difficult to determine O_TMPFILE status after fd has been closed. [Feature #13568] * io.c(rb_file_open_generic): Set Qnil to fptr->pathv when opening a file using O_TMPFILE * file.c(rb_file_path): Raise IOError when fptr->pathv is Qnil * file.c(rb_file_path): [DOC] Update for the new behavior git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_syntax.rb: suppress warningsnobu2017-08-311-1/+1
| | | | | | | * test/ruby/test_syntax.rb (TestSyntax#test_return_toplevel): suppress unreachable statement warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* String#each_grapheme_cluster and String#grapheme_clustersnaruse2017-08-311-0/+40
| | | | | | added to enumerate grapheme clusters [Feature #13780] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_syntax.rb: assert outputnobu2017-08-311-7/+4
| | | | | | | * test/ruby/test_syntax.rb (TestSyntax#test_return_toplevel): assert expected output if given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c: integer calculationsnobu2017-08-301-6/+43
| | | | | | | | | | | | | * array.c (rb_ary_cycle_size, descending_factorial): use rb_int_mul instead of rb_funcallv. * array.c (binomial_coefficient): use rb_int_idiv instead of rb_funcallv. * array.c (rb_ary_repeated_permutation_size): use rb_int_positive_pow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c: join encodingnobu2017-08-291-0/+1
| | | | | | | * array.c (ary_join_1): copy the encoding of the converted string of the first element by to_str too, as an initial encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: tweaked heredocsnobu2017-08-296-32/+53
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: restore cfp at finalizernobu2017-08-231-0/+23
| | | | | | | * gc.c (run_finalizer): restore cfp for the case an exception raised in a finalizer. [ruby-core:82432] [Bug #13832] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* skip unless finalizers runnobu2017-08-231-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: run all finalizersnobu2017-08-231-0/+22
| | | | | | | * gc.c (run_finalizer): revert r59155 partially. finalizing loop should continue even after an exception is rescued. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: primary should not be 0nobu2017-08-221-0/+4
| | | | | | | * parse.y (primary): should not be 0, since it can be a receiver. [ruby-core:82447] [Bug #13836] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c: alias warning at refined methodnobu2017-08-171-0/+17
| | | | | | | | * vm_method.c (rb_method_entry_make): suppress a warning at refined method which will not be redefined. [ruby-core:82385] [Bug #13817] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: unexpected tINTEGER messagenobu2017-08-171-0/+3
| | | | | | | * parse.y (parser_number_literal_suffix): keep token after numeric suffix to show the value in an error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* High Sierra's APFS cannot use invalid filenames [Bug #13816]naruse2017-08-151-1/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: set used flag in gettablenobu2017-08-131-0/+3
| | | | | | | | | | | * parse.y (dvar_defined_ref, dvar_defined): rename macros. only gettable uses the former. assignable should not set LVAR_USED flag. * parse.y (gettable_gen): set used flag on local/dynamic variables instead of setting in lexer. [ruby-core:82368] [Bug #13809] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Suppress warning: shadowing outer local variable - klassnaruse2017-08-121-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* re.c: options for sub-regexpnobu2017-08-111-0/+6
| | | | | | | * re.c (rb_reg_to_s): needs embedded options to check syntax of sub-regexp. [ruby-core:82328] [Bug #13798] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: ignore non-option in shebang linenobu2017-08-101-0/+2
| | | | | | | | * ruby.c (moreswitches): process all words as options only in an environment variable, but not in a shebang line. [ruby-core:82267] [Bug #13786] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fiber#to_s (#inspect) return richer information.ko12017-08-101-0/+12
| | | | | | | | | | * cont.c (fiber_to_s): return with block and status information. * proc.c (proc_to_s_): removed and introduce rb_block_to_s() function to return block information string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: fix KW_SPLAT flag conditionnobu2017-08-101-0/+2
| | | | | | | | * compile.c (compile_array_keyword_arg): fix the condition of KW_SPLAT flag. splat is value node only without key node, simple assoc argument is not. [ruby-core:82291] [Bug #13793] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_args.c: prefer optarg to keyword splatnobu2017-08-101-0/+4
| | | | | | | | * vm_args.c (setup_parameters_complex): prefer optional argument to splat keyword arguments for backward compatibility. [ruby-core:82280] [Bug #13791] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add some more assertions to test_ill_formed_utf_8_replace duerst2017-08-061-0/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* splat keyword hashnobu2017-08-051-0/+11
| | | | | | | | | | * compile.c (compile_array_keyword_arg): set keyword splat flag if explicitly splatted. [ruby-core:68124] [Bug #10856] * vm_args.c (setup_parameters_complex): try keyword hash splat if given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use the same variable name as in dir.ckazu2017-08-031-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: relative path Dir basenobu2017-08-031-0/+2
| | | | | | | * dir.c (glob_helper): fix globbing based on a relative path Dir. [Feature #13056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: relax base optionnobu2017-08-031-0/+3
| | | | | | | * dir.c (dir_glob_options): relax base option. ignore when nil or an empty string as :base option. [Feature #13056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* should not copy promoted flags.ko12017-08-011-0/+10
| | | | | | | | | | | | * include/ruby/ruby.h (rb_clone_setup): should not copy some flags (FL_PROMOTED0|FL_PROMOTED1|FL_FINALIZE). [Bug #13775] * test/ruby/test_object.rb: add a test (note that this test will fail only when RGENGC_CHECK_MODE >= 2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Improve error messagekazu2017-07-311-2/+2
| | | | | | ref [Bug #13761] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* visibility of inherited methodnobu2017-07-291-0/+44
| | | | | | | | | | * vm_insnhelper.c (vm_call_method_each_type): honor the original visibility of inherited methods when a refinement is defined but not activated. [ruby-core:82209] [Bug #13776] Author: Mon_Ouie (Mon ouïe) <mon.ouie@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: brace after array literal argnobu2017-07-261-0/+4
| | | | | | | | | * parse.y (parser_yylex): array is another literal. 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@59420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: limit codepoint lengthnobu2017-07-251-0/+2
| | | | | | | | * parse.y (parser_tokadd_codepoint): limit Unicode codepoint length. too long codepoint has been split unexpectedly since r57050. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sprintf.c: width too bignobu2017-07-231-0/+6
| | | | | | | * sprintf.c (rb_str_format): explicitly reject too big negative width, instead of an empty string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: add String#delete_suffix and String#delete_suffix!sonots2017-07-201-0/+145
| | | | | | | | | | | | | | to remove trailing suffix [Feature #13665] [Fix GH-1661] * string.c (rb_str_delete_suffix_bang): add a new method to remove suffix destuctively. * string.c (rb_str_delete_suffix): add a new method to remove suffix non-destuctively. * test/ruby/test_string.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: empty hash in definednobu2017-07-201-1/+7
| | | | | | | | * parse.y (command): NODE_ARRAY with NULL is invalid. traversal in defined_expr0 is simplified than iseq_compile_each0. [ruby-core:82113] [Bug #13756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: restore stack at returnnobu2017-07-201-0/+1
| | | | | | | | * compile.c (iseq_compile_each0): restore the stack depth after return to the previous depth, to fix the stack depth at returning from rescue iseq. [ruby-core:82108] [Bug #13755] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* random.c: ensure initializednobu2017-07-191-0/+4
| | | | | | | * random.c (get_rnd, try_get_rnd): ensure initialized to get rid of crash in forked processes. [ruby-core:82100] [Bug #13753] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_rand.rb: improved assert_fork_statusnobu2017-07-191-3/+14
| | | | | | | * test/ruby/test_rand.rb (assert_fork_status): deal with errors from children. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r59359, r59356, r59355, r59354normal2017-07-192-44/+0
| | | | | | | These caused numerous CI failures I haven't been able to reproduce [ruby-core:82102] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typonobu2017-07-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e