1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test/ruby/test_optimization.rb (test_string_size): new test

String#size may be overridden, so test for it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2014-10-14 22:01:54 +00:00
parent a1ad7b51f5
commit d63a88c0b5
2 changed files with 9 additions and 0 deletions

View file

@ -1,3 +1,7 @@
Wed Oct 15 07:00:14 2014 Eric Wong <e@80x24.org>
* test/ruby/test_optimization.rb (test_string_size): new test
Wed Oct 15 06:51:13 2014 Eric Wong <e@80x24.org>
* test/ruby/test_optimization.rb (test_string_eq_neq): new test

View file

@ -87,6 +87,11 @@ class TestRubyOptimization < Test::Unit::TestCase
assert_redefine_method('String', 'length', 'assert_nil "string".length')
end
def test_string_size
assert_equal 6, "string".size
assert_redefine_method('String', 'size', 'assert_nil "string".size')
end
def test_string_empty?
assert_equal true, "".empty?
assert_equal false, "string".empty?