summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-string-ext/test/string.rb
diff options
context:
space:
mode:
authortakahashim <[email protected]>2015-11-23 19:51:02 +0900
committertakahashim <[email protected]>2015-11-24 08:39:39 +0900
commit621487a0cd8acc5bbec73c98ebbb23c519ba6e6d (patch)
tree7c28981ea380b3fa0f1bc7f9e59f98e7b2a0cb2d /mrbgems/mruby-string-ext/test/string.rb
parent625a3fee7729a12b0ff613e80b7b45ba0e2f086b (diff)
downloadmruby-621487a0cd8acc5bbec73c98ebbb23c519ba6e6d.tar.gz
mruby-621487a0cd8acc5bbec73c98ebbb23c519ba6e6d.zip
add {Array|Hash|String}.try_convert
Diffstat (limited to 'mrbgems/mruby-string-ext/test/string.rb')
-rw-r--r--mrbgems/mruby-string-ext/test/string.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/mrbgems/mruby-string-ext/test/string.rb b/mrbgems/mruby-string-ext/test/string.rb
index 8324a1613..37a5d28cf 100644
--- a/mrbgems/mruby-string-ext/test/string.rb
+++ b/mrbgems/mruby-string-ext/test/string.rb
@@ -3,6 +3,13 @@
UTF8STRING = ("\343\201\202".size == 1)
+assert('String.try_convert') do
+ assert_nil String.try_convert(nil)
+ assert_nil String.try_convert(:foo)
+ assert_equal "", String.try_convert("")
+ assert_equal "1,2,3", String.try_convert("1,2,3")
+end
+
assert('String#getbyte') do
str1 = "hello"
bytes1 = [104, 101, 108, 108, 111]