summaryrefslogtreecommitdiff
path: root/test/ruby/test_basicinstructions.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-06 17:31:22 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-06 17:31:22 +0000
commit6851ad4756b676fa114e17bc805bc92bb6656caa (patch)
treeff94401e2f871a339697cc3af51b65f96ba87f86 /test/ruby/test_basicinstructions.rb
parent4f74d59be995694a271b1a1a8e7bb45573db2c6d (diff)
* vm_insnhelper.c: attr_writer should return its argument [Bug #7773]
* test/ruby/test_basicinstructions.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_basicinstructions.rb')
-rw-r--r--test/ruby/test_basicinstructions.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/ruby/test_basicinstructions.rb b/test/ruby/test_basicinstructions.rb
index e93b339377..4aa164e0c4 100644
--- a/test/ruby/test_basicinstructions.rb
+++ b/test/ruby/test_basicinstructions.rb
@@ -502,6 +502,7 @@ class TestBasicInstructions < Test::Unit::TestCase
class OP
attr_reader :x
+ attr_accessor :foo
def x=(x)
@x = x
:Bug1996
@@ -602,6 +603,17 @@ class TestBasicInstructions < Test::Unit::TestCase
assert_equal 4, x[0]
end
+ def test_send_opassing
+ bug7773 = '[ruby-core:51821]'
+ x = OP.new
+ assert_equal 42, x.foo = 42, bug7773
+ assert_equal 42, x.foo, bug7773
+ assert_equal -6, x.send(:foo=, -6), bug7773
+ assert_equal -6, x.foo, bug7773
+ assert_equal :Bug1996, x.send(:x=, :case_when_setter_returns_other_value), bug7773
+ assert_equal :case_when_setter_returns_other_value, x.x, bug7773
+ end
+
def test_backref
/re/ =~ 'not match'
assert_nil $~
@@ -683,5 +695,4 @@ class TestBasicInstructions < Test::Unit::TestCase
assert_equal [], [*a]
assert_equal [1], [1, *a]
end
-
end