summaryrefslogtreecommitdiff
path: root/test/-ext-/test_printf.rb
diff options
context:
space:
mode:
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