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:
parent
4900a10689
commit
e8700b596b
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue