提交 edcd9908 编写于 作者: J Justin Collins

Add test for modifying existing ivar

in FindReturnValue
上级 b6801ebf
...@@ -89,6 +89,19 @@ class FindReturnValueTests < Test::Unit::TestCase ...@@ -89,6 +89,19 @@ class FindReturnValueTests < Test::Unit::TestCase
RUBY RUBY
end end
def test_iassgn_as_implicit_return
env = SexpProcessor::Environment.new
env[Sexp.new(:ivar, :@y)] = Sexp.new(:lit, 2)
assert_returns '1', <<-RUBY, env
def x
@y = 1
end
RUBY
assert_equal env[Sexp.new(:ivar, :@y)], Sexp.new(:lit, 1)
end
def test_local_aliasing def test_local_aliasing
assert_returns "'a'", <<-RUBY assert_returns "'a'", <<-RUBY
def x def x
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册