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

* test/ruby/test_symbol.rb (TestSymbol#test_to_proc): Improve tests of Symbol#to_proc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2008-04-22 15:25:23 +00:00
parent bc3ce4588d
commit 44837a4fd2
3 changed files with 19 additions and 7 deletions

View file

@ -1,3 +1,8 @@
Wed Apr 23 00:18:45 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* test/ruby/test_symbol.rb (TestSymbol#test_to_proc): Improve
tests of Symbol#to_proc.
Tue Apr 22 22:43:05 2008 Akinori MUSHA <knu@iDaemons.org>
* eval.c (rb_proc_new, YIELD_FUNC_LAMBDA): Add a new nd_state

View file

@ -77,9 +77,16 @@ class TestSymbol < Test::Unit::TestCase
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]) }
assert_nothing_raised(ArgumentError) { :object_id.to_proc.call([1,[2,3]]) }
[
[],
[1],
[1, 2],
[1, [2, 3]],
].each do |ary|
ary_id = ary.object_id
assert_equal ary_id, :object_id.to_proc.call(ary)
ary_ids = ary.collect{|x| x.object_id }
assert_equal ary_ids, ary.collect(&:object_id)
end
end
end

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.8.7"
#define RUBY_RELEASE_DATE "2008-04-22"
#define RUBY_RELEASE_DATE "2008-04-23"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20080422
#define RUBY_RELEASE_CODE 20080423
#define RUBY_PATCHLEVEL 5000
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 7
#define RUBY_RELEASE_YEAR 2008
#define RUBY_RELEASE_MONTH 4
#define RUBY_RELEASE_DAY 22
#define RUBY_RELEASE_DAY 23
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];