From e8700b596b907ed0db80ccd398d9dfe1f0fe6dd1 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 14 Jul 2019 20:52:49 +0900 Subject: [PATCH] Check the result of String#-@ --- test/ruby/test_string.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 26de52dedb..611bb797bc 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -3177,18 +3177,20 @@ CODE def test_uminus_no_freeze_not_bare str = @cls.new("foo") - -str + assert_instance_of(@cls, -str) assert_equal(false, str.frozen?) str = @cls.new("foo") str.instance_variable_set(:@iv, 1) - -str + assert_instance_of(@cls, -str) assert_equal(false, str.frozen?) + assert_equal(1, str.instance_variable_get(:@iv)) str = @cls.new("foo") str.taint - -str + assert_instance_of(@cls, -str) assert_equal(false, str.frozen?) + assert_predicate(str, :tainted?) end def test_ord