mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-05-16 18:09:31 +08:00
[test] add test for RM-368
This commit is contained in:
@@ -521,6 +521,16 @@ describe "Array" do
|
||||
|
||||
@array.unshift("a")
|
||||
end
|
||||
|
||||
def test_clear
|
||||
obj = @array[0]
|
||||
@array.clear
|
||||
|
||||
obj.inspect
|
||||
|
||||
@array = ["a", "b", "c"]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# RM-354
|
||||
@@ -535,6 +545,19 @@ describe "Array" do
|
||||
# test_array_delete should not cause a crash
|
||||
1.should == 1
|
||||
end
|
||||
|
||||
# RM-368
|
||||
it "#clear should not released the object" do
|
||||
@foo = TestArray.new
|
||||
|
||||
5.times do
|
||||
@foo.performSelectorOnMainThread(:'test_clear', withObject:nil, waitUntilDone:false)
|
||||
NSRunLoop.currentRunLoop.runUntilDate(NSDate.dateWithTimeIntervalSinceNow(0.2))
|
||||
end
|
||||
|
||||
# test_clear should not cause a crash
|
||||
1.should == 1
|
||||
end
|
||||
end
|
||||
|
||||
describe "Struct" do
|
||||
|
||||
Reference in New Issue
Block a user