From ffd0820ab317542f8780aac475da590a4bdbc7a8 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Tue, 24 Sep 2019 20:59:12 -0700 Subject: Deprecate taint/trust and related methods, and make the methods no-ops This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby. --- test/-ext-/string/test_fstring.rb | 30 ------------------------------ test/-ext-/test_printf.rb | 9 --------- 2 files changed, 39 deletions(-) (limited to 'test/-ext-') diff --git a/test/-ext-/string/test_fstring.rb b/test/-ext-/string/test_fstring.rb index 71b12e9cce..d51bb033d3 100644 --- a/test/-ext-/string/test_fstring.rb +++ b/test/-ext-/string/test_fstring.rb @@ -12,36 +12,6 @@ class Test_String_Fstring < Test::Unit::TestCase yield fstr end - def test_taint_shared_string - str = __method__.to_s.dup - str.taint - assert_fstring(str) {|s| assert_predicate(s, :tainted?)} - end - - def test_taint_normal_string - str = __method__.to_s * 3 - str.taint - assert_fstring(str) {|s| assert_predicate(s, :tainted?)} - end - - def test_taint_registered_tainted - str = __method__.to_s * 3 - str.taint - assert_fstring(str) {|s| assert_predicate(s, :tainted?)} - - str = __method__.to_s * 3 - assert_fstring(str) {|s| assert_not_predicate(s, :tainted?)} - end - - def test_taint_registered_untainted - str = __method__.to_s * 3 - assert_fstring(str) {|s| assert_not_predicate(s, :tainted?)} - - str = __method__.to_s * 3 - str.taint - assert_fstring(str) {|s| assert_predicate(s, :tainted?)} - end - def test_instance_variable str = __method__.to_s * 3 str.instance_variable_set(:@test, 42) diff --git a/test/-ext-/test_printf.rb b/test/-ext-/test_printf.rb index feaeadd975..cfec388e8c 100644 --- a/test/-ext-/test_printf.rb +++ b/test/-ext-/test_printf.rb @@ -35,15 +35,6 @@ class Test_SPrintf < Test::Unit::TestCase assert_equal("<\u{3042 3044 3046 3048 304a}>", Bug::Printf.s(self)) end - def test_taint - obj = Object.new.taint - assert_equal({to_s: true, inspect: true}, - { - to_s: Bug::Printf.s(obj).tainted?, - inspect: Bug::Printf.v(obj).tainted?, - }) - end - VS = [ #-0x1000000000000000000000000000000000000000000000002, #-0x1000000000000000000000000000000000000000000000001, -- cgit v1.2.3