summaryrefslogtreecommitdiff
path: root/test/-ext-/test_printf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-25 02:20:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-25 02:20:36 +0000
commit26f96fe1ce6178a83a0b3f0dbb9b4b9c7692103e (patch)
treed9216ee5e033001b6ecc68644dd47009e3f275bb /test/-ext-/test_printf.rb
parent38f0dd0aba75a31008a698362e264ad894c10685 (diff)
* 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/-ext-/test_printf.rb')
-rw-r--r--test/-ext-/test_printf.rb24
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 0000000..f801030
--- /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