diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-25 02:20:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-25 02:20:36 +0000 |
commit | 26f96fe1ce6178a83a0b3f0dbb9b4b9c7692103e (patch) | |
tree | d9216ee5e033001b6ecc68644dd47009e3f275bb /test | |
parent | 38f0dd0aba75a31008a698362e264ad894c10685 (diff) | |
download | ruby-26f96fe1ce6178a83a0b3f0dbb9b4b9c7692103e.tar.gz |
* 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
Diffstat (limited to 'test')
-rw-r--r-- | test/-ext-/test_printf.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/-ext-/test_printf.rb b/test/-ext-/test_printf.rb new file mode 100644 index 0000000000..f801030c07 --- /dev/null +++ b/test/-ext-/test_printf.rb @@ -0,0 +1,24 @@ +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 |