diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-14 20:52:49 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-14 20:56:38 +0900 |
commit | e8700b596b907ed0db80ccd398d9dfe1f0fe6dd1 (patch) | |
tree | 9d9cf46df1d5892319f2daca9199cd3e15926b85 /test | |
parent | 4900a10689036211da79c8189ff7eba11c8c81ee (diff) |
Check the result of String#-@
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_string.rb | 8 |
1 files 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 |