summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-string-ext/test/string.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-09-19 21:51:53 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-11-19 12:05:46 +0900
commitff08856fe314faa4d16b4502c0960a3475387846 (patch)
tree5e5bd17dc3d05a9be4c02fe80d3ecfea0ff68269 /mrbgems/mruby-string-ext/test/string.rb
parentafca99a40b8a3415b3a9a0e8fc41c93ddcbb11d8 (diff)
downloadmruby-ff08856fe314faa4d16b4502c0960a3475387846.tar.gz
mruby-ff08856fe314faa4d16b4502c0960a3475387846.zip
Remove implicit conversion using `to_str` method; fix #3854
We have added internal convenience method `__to_str` which does string type check. The issue #3854 was fixed but fundamental flaw of lack of stack depth check along with fibers still remains. Use `MRB_GC_FIXED_ARENA` for workaround.
Diffstat (limited to 'mrbgems/mruby-string-ext/test/string.rb')
-rw-r--r--mrbgems/mruby-string-ext/test/string.rb11
1 files changed, 0 insertions, 11 deletions
diff --git a/mrbgems/mruby-string-ext/test/string.rb b/mrbgems/mruby-string-ext/test/string.rb
index 781506949..4ccdfd6c3 100644
--- a/mrbgems/mruby-string-ext/test/string.rb
+++ b/mrbgems/mruby-string-ext/test/string.rb
@@ -114,12 +114,6 @@ assert('String#concat') do
assert_equal "Hello World!", "Hello " << "World" << 33
assert_equal "Hello World!", "Hello ".concat("World").concat(33)
- o = Object.new
- def o.to_str
- "to_str"
- end
- assert_equal "hi to_str", "hi " << o
-
assert_raise(TypeError) { "".concat(Object.new) }
end
@@ -128,11 +122,6 @@ assert('String#casecmp') do
assert_equal 0, "aBcDeF".casecmp("abcdef")
assert_equal(-1, "abcdef".casecmp("abcdefg"))
assert_equal 0, "abcdef".casecmp("ABCDEF")
- o = Object.new
- def o.to_str
- "ABCDEF"
- end
- assert_equal 0, "abcdef".casecmp(o)
end
assert('String#count') do