1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (rb_proc_new): Turn the BLOCK_LAMBDA flag on.

* object.c (sym_to_proc), test/ruby/test_symbol.rb: Add back
  Symbol#to_proc, now that it passes the tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2008-04-22 12:42:57 +00:00
parent 185e2676af
commit a2b186bee4
5 changed files with 49 additions and 0 deletions

View file

@ -74,4 +74,11 @@ class TestSymbol < Test::Unit::TestCase
assert_inspect_evaled(':$0')
assert_inspect_evaled(':$1')
end
def test_to_proc
assert_equal %w(1 2 3), (1..3).map(&:to_s)
assert_nothing_raised(ArgumentError) { :object_id.to_proc.call([]) }
assert_nothing_raised(ArgumentError) { :object_id.to_proc.call([1]) }
assert_nothing_raised(ArgumentError) { :object_id.to_proc.call([1,2]) }
end
end