summaryrefslogtreecommitdiff
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index a0c2bf62b7..04e98eca83 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -1559,6 +1559,13 @@ eom
end
end
+ def test_rightward_assign
+ assert_equal(1, eval("1 => a"))
+ assert_equal([2,3], eval("13.divmod(5) => a,b; [a, b]"))
+ assert_equal([2,3,2,3], eval("13.divmod(5) => a,b => c, d; [a, b, c, d]"))
+ assert_equal([2,3], eval("13.divmod(5)\n => a,b; [a, b]"))
+ end
+
private
def not_label(x) @result = x; @not_label ||= nil end