Skip to content

Commit 01b8d3a

Browse files
chrisseatonLillian Zhang
authored andcommitted
Expand detect_recursion specs
1 parent daca151 commit 01b8d3a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spec/truffle/thread/detect_recursion_spec.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,24 @@ def self.check_double_recursion_equality_to_depth(obj1, obj2, depth)
5454

5555
describe "Thread#detect_recursion" do
5656

57+
describe "for empty arrays" do
58+
it "returns false" do
59+
a = []
60+
10.times do |i|
61+
TruffleThreadDetectRecursionSpecFixtures.check_recursion_to_depth(a, i).should be_false
62+
end
63+
end
64+
end
65+
66+
describe "for empty hashes" do
67+
it "returns false" do
68+
a = {}
69+
10.times do |i|
70+
TruffleThreadDetectRecursionSpecFixtures.check_recursion_to_depth(a, i).should be_false
71+
end
72+
end
73+
end
74+
5775
describe "for single arrays" do
5876
it "for non-recursive arrays returns false" do
5977
a = [1,[2,[3], 4],[[[5,6,7]]]]

0 commit comments

Comments
 (0)