From 26f96fe1ce6178a83a0b3f0dbb9b4b9c7692103e Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 25 May 2012 02:20:36 +0000 Subject: * 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 --- test/-ext-/test_printf.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/-ext-/test_printf.rb (limited to 'test/-ext-/test_printf.rb') 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 -- cgit v1.2.3