aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[ruby/io-console] Skip cursor position test on Solaris"Kazuhiro NISHIYAMA2019-09-251-1/+0
| | | | This reverts commit 5294ded681992ced2ecbd31c814b63265d2f591e.
* [ruby/io-console] Unique paths to be addedNobuyoshi Nakada2019-09-251-0/+1
| | | | https://github.com/ruby/io-console/commit/a3ad851b6c
* [ruby/io-console] Load the current librariesNobuyoshi Nakada2019-09-251-1/+3
| | | | https://github.com/ruby/io-console/commit/ab7653c543
* [ruby/io-console] Skip cursor position test on SolarisNobuyoshi Nakada2019-09-251-0/+1
| | | | | | It results in a mysterious failure. https://github.com/ruby/io-console/commit/e3543c3da4
* Make numbered parameters exclusive in a scopeNobuyoshi Nakada2019-09-241-0/+8
|
* Changed numbered parameter prefixNobuyoshi Nakada2019-09-245-38/+32
|
* [ruby/io-console] Made cursor position 0-originNobuyoshi Nakada2019-09-241-0/+20
| | | | https://github.com/ruby/io-console/commit/9377e37295
* Make public_send and rb_f_send handle keyword argument separationJeremy Evans2019-09-231-0/+102
| | | | | Kernel#send takes a different optimized code path that was already handled.
* test/bigdecimal/test_bigdecimal.rb: Use BigDecimal()Yusuke Endoh2019-09-221-1/+1
| | | | instead of deprecated BigDecimal.new.
* Make Kernel#{Pathname,BigDecimal,Complex} return argument if given correct typeJeremy Evans2019-09-213-0/+15
| | | | | | | | | | | | This is how Kernel#{Array,String,Float,Integer,Hash,Rational} work. BigDecimal and Complex instances are always frozen, so this should not cause backwards compatibility issues for those. Pathname instances are not frozen, so potentially this could cause backwards compatibility issues by not returning a new object. Based on a patch from Joshua Ballanco, some minor changes by me. Fixes [Bug #7522]
* Fix Module#class_variables for singleton classes of classes/modulesJeremy Evans2019-09-211-0/+28
| | | | | | | | | | | | | | | | | | | Module#class_variables should reflect class variable lookup. For singleton classes of classes/modules, this means the lookup should be: * Singleton Class * Class * All Ancestors of Class Note that this doesn't include modules included in the singleton class, because class variable lookup doesn't include those. Singleton classes of other objects do not have this behavior and always just search all ancestors of the singleton class, so do not change the behavior for them. Fixes [Bug #8297]
* test/ruby/test_assignment.rb: use bug number for assert messageYusuke Endoh2019-09-211-8/+8
| | | | to suppress variable unused warning
* Handle keyword argument separation for Enumerator#sizeJeremy Evans2019-09-201-0/+99
| | | | | | | | | When Object#to_enum is passed a block, the block is called to get a size with the arguments given to to_enum. This calls the block with the same keyword flag as to_enum is called with. This requires adding rb_check_funcall_kw and rb_check_funcall_default_kw to handle keyword flags.
* Make passing empty keywords to dig pass empty keywords to next dig methodJeremy Evans2019-09-201-0/+220
| | | | | | | | | | | | | | | | If defined in Ruby, dig would be defined as def dig(arg, *rest) end, it would not use keywords. If the last dig argument was an empty hash, it could be treated as keyword arguments by the next dig method. Allow dig to pass along the empty keyword flag if called with an empty keyword, to suppress the previous behavior and force treating the hash as a positional argument and not keywords. Also handle the case where dig calls method_missing, passing the empty keyword flag to that as well. This requires adding rb_check_funcall_with_hook_kw functions, so that dig can specify how arguments are treated. It also adds kw_splat arguments to a couple static functions.
* Allows calling a private method only with bare `self`Nobuyoshi Nakada2019-09-201-0/+1
|
* Removed Synchronizer from the ruby repository.Hiroshi SHIBATA2019-09-201-69/+0
|
* Removed Shell from the ruby repository.Hiroshi SHIBATA2019-09-201-83/+0
|
* Removed Scanf from the ruby repository.Hiroshi SHIBATA2019-09-204-421/+0
|
* Removed CMath from the ruby repository.Hiroshi SHIBATA2019-09-201-116/+0
|
* Allow calling a private accessor with `self.`Nobuyoshi Nakada2019-09-201-4/+4
| | | | [Feature #11297] [Feature #16123]
* Allow calling a private method with `self.`Dylan Thacker-Smith2019-09-203-3/+4
| | | | | | | | | | This makes it consistent with calling private attribute assignment methods, which currently is allowed (e.g. `self.value =`). Calling a private method in this way can be useful when trying to assign the return value to a local variable with the same name. [Feature #11297] [Feature #16123]
* Separate Time#inspect from to_s and show subsec [Feature #15958]NARUSE, Yui2019-09-191-0/+24
|
* Fixed reserved numbered parameter warningNobuyoshi Nakada2019-09-191-0/+1
|
* DEBUG: cxxanyargsNobuyoshi Nakada2019-09-191-2/+0
|
* DEBUGNobuyoshi Nakada2019-09-191-0/+2
|
* Add and fix some keyword testsJeremy Evans2019-09-181-17/+182
| | | | | | | | | | Replace [arg=1, args] with [arg, args] so we can actually test the value correctly. Add some missing tests for **h3 when method accepts (**args). Add tests for passing positional hashes to (**args) methods and check for the expected warnings/errors.
* Fix keyword argument separation issues with sym procs when using refinementsJeremy Evans2019-09-171-0/+303
| | | | | | | | | | | | Make sure that vm_yield_with_cfunc can correctly set the empty keyword flag by passing 2 as the kw_splat value when calling it in vm_invoke_ifunc_block. Make sure calling.kw_splat is set to 1 and not 128 in vm_sendish, so we can safely check for different kw_splat values. vm_args.c needs to call add_empty_keyword, and to make JIT happy, the function needs to be exported. Rename the function to rb_adjust_argv_kw_splat to more accurately reflect what it does, and mark it as MJIT exported.
* Pass keyword argument flag when rb_call_super_kw calls method_missingJeremy Evans2019-09-171-0/+194
| | | | | | | | This makes method_missing take a flag for whether keyword arguments were passed. Adds tests both for rb_call_super_kw usage as well as general usage of super calling method_missing in Ruby methods.
* Comment lines can be placed between fluent dot nowNobuyoshi Nakada2019-09-151-0/+3
|
* Correctly handle keywords for Method#call for cfuncs, send, and attr_*Jeremy Evans2019-09-131-0/+554
| | | | | | | | | This sets the correct VM frame flags when using Method#call to call funcs, and handles empty keyword hashes for cfuncs, attr_reader, and attr_writer. It also fixes calls to send through Method#call. It adds tests for all of those, as well as tests for using Method#call to call define_method, lambda, and sym_procs (which didn't require code changes).
* Name dynamically defined methods with line numbersNobuyoshi Nakada2019-09-131-35/+35
|
* Document and test Enumerator.produceAkinori MUSHA2019-09-121-0/+45
| | | | Co-authored-by: Victor Shepelev <zverok.offline@gmail.com>
* Emit missing keyword argument separation warnings for define_methodJeremy Evans2019-09-111-0/+22
| | | | | | | | | Previously, the warning functions skipped warning in these cases. This removes the skipping, and uses a less descriptive warning instead. This affected both last argument to keyword warnings and keyword split warnings.
* Remove check of ai.protocolMasaki Matsushita2019-09-101-1/+0
| | | | Solaris 10 returns addrinfo.ai_protocol as 0, not 6.
* Support timeout for AddrinfoMasaki Matsushita2019-09-101-0/+5
| | | | | | | | | | | | Addrinfo.getaddrinfo and .foreach now accepts :timeout in seconds as a keyword argument. If getaddrinfo_a(3) is available, the timeout will be applied for name resolution. Otherwise, it will be ignored. Socket.tcp accepts :resolv_timeout to use this feature. This commit is retry of 6382f5cc91ac9e36776bc854632d9a1237250da7. Test was failed on Solaris machines which don't have "http" in /etc/services. In this commit, use "ssh" instead.
* Revert "Support timeout for Addrinfo"Masaki Matsushita2019-09-091-5/+0
| | | | | This reverts commit 6382f5cc91ac9e36776bc854632d9a1237250da7. test failed on Solaris.
* Make test-all and test-spec runnable on AndroidYusuke Endoh2019-09-095-0/+13
| | | | | | Calling some syscall functions such as Dir.chroot causes SIGSYS instead of EPERM on Android. This change skips all tests that stops the test-suite run.
* Fix expected ip_portMasaki Matsushita2019-09-091-1/+1
|
* Fix service name for testMasaki Matsushita2019-09-091-1/+1
| | | | change service name to fix failed test on Solaris
* Fix domain name for testMasaki Matsushita2019-09-091-1/+1
|
* Fix invalid keyword argument separation warning for delegating callsJeremy Evans2019-09-081-0/+1
| | | | | | | | | | | | | | | | | | | | This removes an invalid keyword argument separation warning for code such as: ```ruby def foo(arg) arg end kw = {} foo(*[1], **kw) ``` This warning was caused because the remove_empty_keyword_hash was set based on a comparison with two variables, and in this case, one of the variables was updated after the check and we need to use the updated variable. Simplify things by just inlining the comparison.
* Support timeout for AddrinfoMasaki Matsushita2019-09-091-0/+5
| | | | | | | | Addrinfo.getaddrinfo and .foreach now accepts :timeout in seconds as a keyword argument. If getaddrinfo_a(3) is available, the timeout will be applied for name resolution. Otherwise, it will be ignored. Socket.tcp accepts :resolv_timeout to use this feature.
* Add keyword argument separation tests for implicit/explicit super callsJeremy Evans2019-09-081-0/+220
| | | | | No code changes are necessary, but we didn't have as extensive tests for these calls previously.
* compile.c (compile_list): emit newarraykwsplat only at the last chunkYusuke Endoh2019-09-071-0/+8
| | | | | | | `[{}, {}, {}, ..., {}, *{}]` is wrongly created. A big array literal is created and concatenated for every 256 elements. The newarraykwsplat must be emitted only at the last chunk.
* Rename NODE_ARRAY to NODE_LIST to reflect its actual use casesYusuke Endoh2019-09-071-1/+1
| | | | | | | | | | and NODE_ZARRAY to NODE_ZLIST. NODE_ARRAY is used not only by an Array literal, but also the contents of Hash literals, method call arguments, dynamic string literals, etc. In addition, the structure of NODE_ARRAY is a linked list, not an array. This is very confusing, so I believe `NODE_LIST` is a better name.
* Fix keyword argument warnings in the tests from Class#newJeremy Evans2019-09-064-6/+6
| | | | This were previously hidden because calls from C were not warned.
* Convert keyword argument to required positional hash argument for Class#new, ↵Jeremy Evans2019-09-061-20/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Method#call, UnboundMethod#bind_call Also add keyword argument separation warnings for Class#new and Method#call. To allow for keyword argument to required positional hash converstion in cfuncs, add a vm frame flag indicating the cfunc was called with an empty keyword hash (which was removed before calling the cfunc). The cfunc can check this frame flag and add back an empty hash if it is passing its arguments to another Ruby method. Add rb_empty_keyword_given_p function for checking if called with an empty keyword hash, and rb_add_empty_keyword for adding back an empty hash to argv. All of this empty keyword argument support is only for 2.7. It will be removed in 3.0 as Ruby 3 will not convert empty keyword arguments to required positional hash arguments. Comment all of the relevent code to make it obvious this is expected to be removed. Add rb_funcallv_kw as an public C-API function, just like rb_funcallv but with a keyword flag. This is used by rb_obj_call_init (internals of Class#new). This also required expected call_type enum with CALL_FCALL_KW, similar to the recent addition of CALL_PUBLIC_KW. Add rb_vm_call_kw as a internal function, used by call_method_data (internals of Method#call and UnboundMethod#bind_call). Add tests for UnboundMethod#bind_call keyword handling.
* Try shrinking tested VM stack maxTakashi Kokubun2019-09-061-2/+2
|
* Convert empty keyword hash to required positional argument and warn for ↵Jeremy Evans2019-09-051-4/+12
| | | | | | | | method_missing This is the same as the bmethod, sym proc, and send cases, where we don't remove the keyword splat, so later code can move it to a required positional parameter and warn.
* Convert empty keyword hash to required positional argument and warn for sym ↵Jeremy Evans2019-09-051-4/+12
| | | | | | | | procs This is the same as the bmethod and send cases, where we don't remove the keyword splat, so later code can move it to to a a required positional parameter and warn.