diff options
| author | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-22 15:25:23 +0000 |
|---|---|---|
| committer | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-22 15:25:23 +0000 |
| commit | 44837a4fd29a72ec0f08945040707598043c2ccd (patch) | |
| tree | 95b65250a027e803e4e70c429dae4ea20ef40294 | |
| parent | bc3ce4588d886202c2422e5dc4010e1c7e83ce38 (diff) | |
* 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
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | test/ruby/test_symbol.rb | 15 | ||||
| -rw-r--r-- | version.h | 6 |
3 files changed, 19 insertions, 7 deletions
@@ -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 diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index 4d29d96f51..42350ba6e7 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -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 @@ -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[]; |
