Skip to content

Commit

Permalink
Revert "Temporarily comment out these syntax tests"
Browse files Browse the repository at this point in the history
This reverts commit 73c87e7.
  • Loading branch information
headius committed Mar 20, 2024
1 parent c0257af commit f4138d8
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions test/mri/ruby/test_keyword.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ def test_method_parameters
[:keyrest, :kw], [:block, :b]], method(:f9).parameters)
end

# def test_keyword_with_anonymous_keyword_splat
# def self.a(b: 1, **) [b, **] end
# kw = {b: 2, c: 3}
# assert_equal([2, {c: 3}], a(**kw))
# assert_equal({b: 2, c: 3}, kw)
# end
def test_keyword_with_anonymous_keyword_splat
def self.a(b: 1, **) [b, **] end
kw = {b: 2, c: 3}
assert_equal([2, {c: 3}], a(**kw))
assert_equal({b: 2, c: 3}, kw)
end

def test_keyword_splat_nil
# cfunc call
Expand Down Expand Up @@ -2817,23 +2817,23 @@ class << o
assert_raise(FrozenError) { c.send(:ruby2_keywords, :baz) }
end

# def test_anon_splat_ruby2_keywords
# singleton_class.class_exec do
# def bar(*a, **kw)
# [a, kw]
# end
#
# ruby2_keywords def bar_anon(*)
# bar(*)
# end
# end
#
# a = [1, 2]
# kw = {a: 1}
# assert_equal([[1, 2], {a: 1}], bar_anon(*a, **kw))
# assert_equal([1, 2], a)
# assert_equal({a: 1}, kw)
# end
def test_anon_splat_ruby2_keywords
singleton_class.class_exec do
def bar(*a, **kw)
[a, kw]
end

ruby2_keywords def bar_anon(*)
bar(*)
end
end

a = [1, 2]
kw = {a: 1}
assert_equal([[1, 2], {a: 1}], bar_anon(*a, **kw))
assert_equal([1, 2], a)
assert_equal({a: 1}, kw)
end

def test_top_ruby2_keywords
assert_in_out_err([], <<-INPUT, ["[1, 2, 3]", "{:k=>1}"], [])
Expand Down

0 comments on commit f4138d8

Please sign in to comment.