зеркало из https://github.com/github/ruby.git
Add an assertion that `%x` literals call `` ` `` method
This commit is contained in:
Родитель
c0629a055a
Коммит
ccffc6ee09
|
@ -527,7 +527,7 @@ class TestParse < Test::Unit::TestCase
|
||||||
def t.`(x); "foo" + x + "bar"; end
|
def t.`(x); "foo" + x + "bar"; end
|
||||||
END
|
END
|
||||||
end
|
end
|
||||||
a = b = nil
|
a = b = c = nil
|
||||||
assert_nothing_raised do
|
assert_nothing_raised do
|
||||||
eval <<-END, nil, __FILE__, __LINE__+1
|
eval <<-END, nil, __FILE__, __LINE__+1
|
||||||
a = t.` "zzz"
|
a = t.` "zzz"
|
||||||
|
@ -535,10 +535,12 @@ class TestParse < Test::Unit::TestCase
|
||||||
END
|
END
|
||||||
t.instance_eval <<-END, __FILE__, __LINE__+1
|
t.instance_eval <<-END, __FILE__, __LINE__+1
|
||||||
b = `zzz`
|
b = `zzz`
|
||||||
|
c = %x(ccc)
|
||||||
END
|
END
|
||||||
end
|
end
|
||||||
assert_equal("foozzzbar", a)
|
assert_equal("foozzzbar", a)
|
||||||
assert_equal("foozzzbar", b)
|
assert_equal("foozzzbar", b)
|
||||||
|
assert_equal("foocccbar", c)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_carrige_return
|
def test_carrige_return
|
||||||
|
|
Загрузка…
Ссылка в новой задаче