mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-08 17:56:38 +08:00
add test for RM-354
This commit is contained in:
@@ -507,6 +507,36 @@ describe "Hash" do
|
||||
end
|
||||
end
|
||||
|
||||
describe "Array" do
|
||||
class TestArray
|
||||
def initialize
|
||||
@array = ["a", "b", "c"]
|
||||
end
|
||||
|
||||
def test_array_delete
|
||||
obj = @array[0]
|
||||
@array.delete("a")
|
||||
|
||||
obj.inspect
|
||||
|
||||
@array.unshift("a")
|
||||
end
|
||||
end
|
||||
|
||||
# RM-354
|
||||
it "#delete should not released the object" do
|
||||
@foo = TestArray.new
|
||||
|
||||
5.times do
|
||||
@foo.performSelectorOnMainThread(:'test_array_delete', withObject:nil, waitUntilDone:false)
|
||||
NSRunLoop.currentRunLoop.runUntilDate(NSDate.dateWithTimeIntervalSinceNow(0.2))
|
||||
end
|
||||
|
||||
# test_array_delete should not cause a crash
|
||||
1.should == 1
|
||||
end
|
||||
end
|
||||
|
||||
# RM-290
|
||||
describe "NSMutableData" do
|
||||
class NSMutableData
|
||||
|
||||
Reference in New Issue
Block a user