diff options
Diffstat (limited to 'test/-ext-')
-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 |