summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_assignment.rb5
-rw-r--r--test/ruby/test_parse.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_assignment.rb b/test/ruby/test_assignment.rb
index daf1f0a9be..41c14d3a44 100644
--- a/test/ruby/test_assignment.rb
+++ b/test/ruby/test_assignment.rb
@@ -552,6 +552,11 @@ class TestAssignment < Test::Unit::TestCase
a, b = Base::A, Base::B
assert_equal [3,4], [a,b]
end
+
+ def test_massign_in_cond
+ result = eval("if (a, b = MyObj.new); [a, b]; end", nil, __FILE__, __LINE__)
+ assert_equal [[1,2],[3,4]], result
+ end
end
require_relative 'sentence'
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index 42df89189c..9f83598ceb 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -781,7 +781,7 @@ x = __ENCODING__
end
def test_assign_in_conditional
- assert_raise(SyntaxError) do
+ assert_nothing_raised do
eval <<-END, nil, __FILE__, __LINE__+1
(x, y = 1, 2) ? 1 : 2
END