diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-06 17:15:45 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-06 17:15:45 +0000 |
commit | 44374034268913246d517ff25365e0bccb453e02 (patch) | |
tree | 99b402caebc8f0d2251de279bdfdfe8b5f96a863 /test | |
parent | 3a4eb4dd39b4a6687068de391c8543008c3f977c (diff) | |
download | ruby-44374034268913246d517ff25365e0bccb453e02.tar.gz |
* string.c: Support for String#{each_byte,each_char,each_codepoint}.size
[Feature #6636]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_enumerator.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb index 2c5158e726..896bf3f3f2 100644 --- a/test/ruby/test_enumerator.rb +++ b/test/ruby/test_enumerator.rb @@ -550,5 +550,11 @@ class TestEnumerator < Test::Unit::TestCase assert_equal 102, 1.downto(-100).size assert_equal Float::INFINITY, 42.upto(Float::INFINITY).size end + + def test_size_for_string + assert_equal 5, 'hello'.each_byte.size + assert_equal 5, 'hello'.each_char.size + assert_equal 5, 'hello'.each_codepoint.size + end end |