summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2019-09-25Revert "[ruby/io-console] Skip cursor position test on Solaris"Kazuhiro NISHIYAMA
This reverts commit 5294ded681992ced2ecbd31c814b63265d2f591e.
2019-09-25[ruby/io-console] Unique paths to be addedNobuyoshi Nakada
https://github.com/ruby/io-console/commit/a3ad851b6c
2019-09-25[ruby/io-console] Load the current librariesNobuyoshi Nakada
https://github.com/ruby/io-console/commit/ab7653c543
2019-09-25[ruby/io-console] Skip cursor position test on SolarisNobuyoshi Nakada
It results in a mysterious failure. https://github.com/ruby/io-console/commit/e3543c3da4
2019-09-24Make numbered parameters exclusive in a scopeNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2431
2019-09-24Changed numbered parameter prefixNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2431
2019-09-24[ruby/io-console] Made cursor position 0-originNobuyoshi Nakada
https://github.com/ruby/io-console/commit/9377e37295
2019-09-23Make public_send and rb_f_send handle keyword argument separationJeremy Evans
Kernel#send takes a different optimized code path that was already handled. Notes: Merged: https://github.com/ruby/ruby/pull/2481
2019-09-22test/bigdecimal/test_bigdecimal.rb: Use BigDecimal()Yusuke Endoh
instead of deprecated BigDecimal.new.
2019-09-21Make Kernel#{Pathname,BigDecimal,Complex} return argument if given correct typeJeremy Evans
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] Notes: Merged: https://github.com/ruby/ruby/pull/2473
2019-09-21Fix Module#class_variables for singleton classes of classes/modulesJeremy Evans
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] Notes: Merged: https://github.com/ruby/ruby/pull/2478
2019-09-21test/ruby/test_assignment.rb: use bug number for assert messageYusuke Endoh
to suppress variable unused warning
2019-09-20Handle keyword argument separation for Enumerator#sizeJeremy Evans
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.
2019-09-20Make passing empty keywords to dig pass empty keywords to next dig methodJeremy Evans
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.
2019-09-20Allows calling a private method only with bare `self`Nobuyoshi Nakada
2019-09-20Removed Synchronizer from the ruby repository.Hiroshi SHIBATA
2019-09-20Removed Shell from the ruby repository.Hiroshi SHIBATA
2019-09-20Removed Scanf from the ruby repository.Hiroshi SHIBATA
2019-09-20Removed CMath from the ruby repository.Hiroshi SHIBATA
2019-09-20Allow calling a private accessor with `self.`Nobuyoshi Nakada
[Feature #11297] [Feature #16123] Notes: Merged: https://github.com/ruby/ruby/pull/2474
2019-09-20Allow calling a private method with `self.`Dylan Thacker-Smith
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] Notes: Merged: https://github.com/ruby/ruby/pull/2474
2019-09-19Separate Time#inspect from to_s and show subsec [Feature #15958]NARUSE, Yui
2019-09-19Fixed reserved numbered parameter warningNobuyoshi Nakada
2019-09-19DEBUG: cxxanyargsNobuyoshi Nakada
2019-09-19DEBUGNobuyoshi Nakada
2019-09-18Add and fix some keyword testsJeremy Evans
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.
2019-09-17Fix keyword argument separation issues with sym procs when using refinementsJeremy Evans
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. Notes: Merged: https://github.com/ruby/ruby/pull/2462
2019-09-17Pass keyword argument flag when rb_call_super_kw calls method_missingJeremy Evans
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. Notes: Merged: https://github.com/ruby/ruby/pull/2462
2019-09-15Comment lines can be placed between fluent dot nowNobuyoshi Nakada
2019-09-13Correctly handle keywords for Method#call for cfuncs, send, and attr_*Jeremy Evans
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).
2019-09-13Name dynamically defined methods with line numbersNobuyoshi Nakada
2019-09-12Document and test Enumerator.produceAkinori MUSHA
Co-authored-by: Victor Shepelev <zverok.offline@gmail.com>
2019-09-11Emit missing keyword argument separation warnings for define_methodJeremy Evans
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.
2019-09-10Remove check of ai.protocolMasaki Matsushita
Solaris 10 returns addrinfo.ai_protocol as 0, not 6.
2019-09-10Support timeout for AddrinfoMasaki Matsushita
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.
2019-09-09Revert "Support timeout for Addrinfo"Masaki Matsushita
This reverts commit 6382f5cc91ac9e36776bc854632d9a1237250da7. test failed on Solaris.
2019-09-09Make test-all and test-spec runnable on AndroidYusuke Endoh
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.
2019-09-09Fix expected ip_portMasaki Matsushita
2019-09-09Fix service name for testMasaki Matsushita
change service name to fix failed test on Solaris
2019-09-09Fix domain name for testMasaki Matsushita
2019-09-08Fix invalid keyword argument separation warning for delegating callsJeremy Evans
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.
2019-09-09Support timeout for AddrinfoMasaki Matsushita
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.
2019-09-08Add keyword argument separation tests for implicit/explicit super callsJeremy Evans
No code changes are necessary, but we didn't have as extensive tests for these calls previously.
2019-09-07compile.c (compile_list): emit newarraykwsplat only at the last chunkYusuke Endoh
`[{}, {}, {}, ..., {}, *{}]` 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.
2019-09-07Rename NODE_ARRAY to NODE_LIST to reflect its actual use casesYusuke Endoh
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.
2019-09-06Fix keyword argument warnings in the tests from Class#newJeremy Evans
This were previously hidden because calls from C were not warned. Notes: Merged: https://github.com/ruby/ruby/pull/2432
2019-09-06Convert keyword argument to required positional hash argument for Class#new, ↵Jeremy Evans
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. Notes: Merged: https://github.com/ruby/ruby/pull/2432
2019-09-06Try shrinking tested VM stack maxTakashi Kokubun
2019-09-05Convert empty keyword hash to required positional argument and warn for ↵Jeremy Evans
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.
2019-09-05Convert empty keyword hash to required positional argument and warn for sym ↵Jeremy Evans
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.