summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-15 08:39:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-15 08:39:07 +0000
commitaafeb4b724e91e4cd7eb6da01ec68d7c60a78cc1 (patch)
treec34842a90263f6c69764354cd57ca428b0c6c5f5 /test
parent0279a90c73b233e334833add57da4f5b3472fb4b (diff)
test_sprintf.rb: test for %p
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_sprintf.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb
index 163d37256c..7986e9d141 100644
--- a/test/ruby/test_sprintf.rb
+++ b/test/ruby/test_sprintf.rb
@@ -238,6 +238,12 @@ class TestSprintf < Test::Unit::TestCase
assert_equal("with options {:capture=>/\\d+/}", sprintf("with options %p" % options))
end
+ def test_inspect
+ obj = Object.new
+ def obj.inspect; "TEST"; end
+ assert_equal("<TEST>", sprintf("<%p>", obj))
+ end
+
def test_invalid
# Star precision before star width:
assert_raise(ArgumentError, "[ruby-core:11569]") {sprintf("%.**d", 5, 10, 1)}