aboutsummaryrefslogtreecommitdiffstats
path: root/test/-ext-/test_printf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-15 07:26:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-15 07:26:55 +0000
commit665b06ec5bf747c13ff7c5fa9b003d5ca2540709 (patch)
tree4491320d7266e2bde338e9a8dd8938e612d84243 /test/-ext-/test_printf.rb
parentbb545e213146685e0cdddb064ecc3b22139e01f9 (diff)
downloadruby-665b06ec5bf747c13ff7c5fa9b003d5ca2540709.tar.gz
sprintf.c: infect
* sprintf.c (ruby__sfvextra): the result should be infected by the given strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-/test_printf.rb')
-rw-r--r--test/-ext-/test_printf.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/-ext-/test_printf.rb b/test/-ext-/test_printf.rb
index fc4e065345..4c4001654a 100644
--- a/test/-ext-/test_printf.rb
+++ b/test/-ext-/test_printf.rb
@@ -28,4 +28,26 @@ class Test_SPrintf < Test::Unit::TestCase
end
assert_equal("<\u{3042 3044 3046 3048 304a}>", Bug::Printf.s(self))
end
+
+ def test_taint
+ def self.to_s
+ super.taint
+ end
+ assert_equal({to_s: true, inspect: true},
+ {
+ to_s: Bug::Printf.s(self).tainted?,
+ inspect: Bug::Printf.v(self).tainted?,
+ })
+ end
+
+ def test_trust
+ def self.to_s
+ super.untrust
+ end
+ assert_equal({to_s: true, inspect: true},
+ {
+ to_s: Bug::Printf.s(self).untrusted?,
+ inspect: Bug::Printf.v(self).untrusted?,
+ })
+ end
end