From ccffc6ee09d51b840ec00c25b815cac26ca45025 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 2 Feb 2024 14:26:20 +0900 Subject: [PATCH] Add an assertion that `%x` literals call `` ` `` method --- test/ruby/test_parse.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index f68bf96cd1..6b8c196a84 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -527,7 +527,7 @@ class TestParse < Test::Unit::TestCase def t.`(x); "foo" + x + "bar"; end END end - a = b = nil + a = b = c = nil assert_nothing_raised do eval <<-END, nil, __FILE__, __LINE__+1 a = t.` "zzz" @@ -535,10 +535,12 @@ class TestParse < Test::Unit::TestCase END t.instance_eval <<-END, __FILE__, __LINE__+1 b = `zzz` + c = %x(ccc) END end assert_equal("foozzzbar", a) assert_equal("foozzzbar", b) + assert_equal("foocccbar", c) end def test_carrige_return