summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorDaniel Bovensiepen <[email protected]>2012-11-01 16:40:31 +0800
committerDaniel Bovensiepen <[email protected]>2012-11-01 16:40:31 +0800
commitb9cf5045b7e10ad722475a432db4fe1b38987cbd (patch)
treed4c4c8d94577f35fc9f5ddbf3cd4d692e415f73d /test
parent8d9f5628eda4f1353c2578900b6396a7e06f281b (diff)
downloadmruby-b9cf5045b7e10ad722475a432db4fe1b38987cbd.tar.gz
mruby-b9cf5045b7e10ad722475a432db4fe1b38987cbd.zip
Add Test for String#each_byte
Diffstat (limited to 'test')
-rw-r--r--test/t/string.rb10
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
+