1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Check the result of String#-@

This commit is contained in:
Nobuyoshi Nakada 2019-07-14 20:52:49 +09:00
parent 4900a10689
commit e8700b596b
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -3177,18 +3177,20 @@ CODE
def test_uminus_no_freeze_not_bare def test_uminus_no_freeze_not_bare
str = @cls.new("foo") str = @cls.new("foo")
-str assert_instance_of(@cls, -str)
assert_equal(false, str.frozen?) assert_equal(false, str.frozen?)
str = @cls.new("foo") str = @cls.new("foo")
str.instance_variable_set(:@iv, 1) str.instance_variable_set(:@iv, 1)
-str assert_instance_of(@cls, -str)
assert_equal(false, str.frozen?) assert_equal(false, str.frozen?)
assert_equal(1, str.instance_variable_get(:@iv))
str = @cls.new("foo") str = @cls.new("foo")
str.taint str.taint
-str assert_instance_of(@cls, -str)
assert_equal(false, str.frozen?) assert_equal(false, str.frozen?)
assert_predicate(str, :tainted?)
end end
def test_ord def test_ord