diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/string.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/t/string.rb b/test/t/string.rb index 1a917b1c4..26b7df584 100644 --- a/test/t/string.rb +++ b/test/t/string.rb @@ -346,3 +346,13 @@ assert('String#bytes') do str1.bytes == bytes1 end +assert('String#each_byte') do + str1 = "hello" + bytes1 = [104, 101, 108, 108, 111] + bytes2 = [] + + str1.each_byte {|b| bytes2 << b } + + bytes1 == bytes2 +end + |
