1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/-ext-/test_printf.rb
nobu 26f96fe1ce * test/-ext-/test_printf.rb: tests for [Feature #5896].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-25 02:20:36 +00:00

24 lines
465 B
Ruby

require 'test/unit'
require "-test-/printf"
class Test_SPrintf < Test::Unit::TestCase
def to_s
"#{self.class}:#{object_id}"
end
def inspect
"<#{self.class}:#{object_id}>"
end
def test_int
assert_match(/\A<-?\d+>\z/, Bug::Printf.i(self))
end
def test_to_str
assert_equal("<#{self.class}:#{object_id}>", Bug::Printf.s(self))
end
def test_inspect
assert_equal("{<#{self.class}:#{object_id}>}", Bug::Printf.v(self))
end
end