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:
parent
a1ad7b51f5
commit
d63a88c0b5
2 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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?
|
||||
|
|
Loading…
Reference in a new issue