ruby-changes:56485
From: Nobuyoshi <ko1@a...>
Date: Sun, 14 Jul 2019 20:57:16 +0900 (JST)
Subject: [ruby-changes:56485] Nobuyoshi Nakada: e8700b596b (master): Check the result of String#-@
https://git.ruby-lang.org/ruby.git/commit/?id=e8700b596b From e8700b596b907ed0db80ccd398d9dfe1f0fe6dd1 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 14 Jul 2019 20:52:49 +0900 Subject: Check the result of String#-@ diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 26de52d..611bb79 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -3177,18 +3177,20 @@ CODE https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L3177 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/