summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-02-02 14:26:20 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2024-02-02 14:26:20 +0900
commitccffc6ee09d51b840ec00c25b815cac26ca45025 (patch)
tree1a8d608aafe8cd8c66e6e700f51835c22ab7b959 /test/ruby
parentc0629a055ada4efcd6f520a8ff6f6d4d71e878a0 (diff)
Add an assertion that `%x` literals call `` ` `` method
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_parse.rb4
1 files changed, 3 insertions, 1 deletions
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