зеркало из https://github.com/github/ruby.git
YJIT: Test more kw and rest cases and change exit name
This commit is contained in:
Родитель
dabeec8034
Коммит
a8782c454c
|
@ -3802,16 +3802,18 @@ assert_equal '[{"/a"=>"b", :as=>:c, :via=>:post}, [], nil]', %q{
|
|||
}
|
||||
|
||||
# Test rest and kw_args
|
||||
assert_equal '[[["test"], nil, true], [["test"], :base, true]]', %q{
|
||||
assert_equal '[true, true, true, true]', %q{
|
||||
def my_func(*args, base: nil, sort: true)
|
||||
[args, base, sort]
|
||||
end
|
||||
|
||||
def calling_my_func
|
||||
result = []
|
||||
result << my_func("test")
|
||||
result << my_func("test", base: :base)
|
||||
results = []
|
||||
results << (my_func("test") == [["test"], nil, true])
|
||||
results << (my_func("test", base: :base) == [["test"], :base, true])
|
||||
results << (my_func("test", sort: false) == [["test"], nil, false])
|
||||
results << (my_func("test", "other", base: :base) == [["test", "other"], :base, true])
|
||||
results
|
||||
end
|
||||
|
||||
calling_my_func
|
||||
}
|
||||
|
|
|
@ -5463,7 +5463,7 @@ fn gen_send_iseq(
|
|||
}
|
||||
|
||||
if iseq_has_rest && unsafe { get_iseq_flags_has_kw(iseq) } && supplying_kws {
|
||||
gen_counter_incr!(asm, send_iseq_has_rest_and_kw_supplying);
|
||||
gen_counter_incr!(asm, send_iseq_has_rest_and_kw_supplied);
|
||||
return CantCompile;
|
||||
}
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ make_counters! {
|
|||
send_send_builtin,
|
||||
send_iseq_has_rest_and_captured,
|
||||
send_iseq_has_rest_and_send,
|
||||
send_iseq_has_rest_and_kw_supplying,
|
||||
send_iseq_has_rest_and_kw_supplied,
|
||||
send_iseq_has_rest_and_optional,
|
||||
send_iseq_has_rest_and_splat_not_equal,
|
||||
send_is_a_class_mismatch,
|
||||
|
|
Загрузка…
Ссылка в новой задаче