Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #519 from jerith/jerith/per-method-recursion-guard
Per-method recursion guard
- Loading branch information
Showing
with
81 additions
and 37 deletions.
- +5 −7 lib-topaz/array.rb
- +0 −3 spec/tags/core/array/inspect_tags.txt
- +0 −5 spec/tags/core/array/reject_tags.txt
- +0 −1 spec/tags/core/hash/equal_value_tags.txt
- +41 −0 tests/objects/test_threadobject.py
- +5 −4 tests/test_executioncontext.py
- +18 −7 topaz/executioncontext.py
- +3 −2 topaz/objects/fileobject.py
- +9 −8 topaz/objects/threadobject.py
@@ -1,7 +1,2 @@ | ||
fails:Array#reject returns a new array without elements for which block is true | ||
fails:Array#reject returns self when called on an Array emptied with #shift | ||
fails:Array#reject properly handles recursive arrays | ||
fails:Array#reject does not return subclass instance on Array subclasses | ||
fails:Array#reject does not retain instance variables | ||
fails:Array#reject returns an Enumerator if no block given | ||
fails:Array#reject! returns an Enumerator if no block given |
@@ -1,4 +1,3 @@ | ||
fails:Hash#== computes equality for complex recursive hashes | ||
fails:Hash#== computes equality for recursive hashes & arrays | ||
fails:Hash#== compares the values in self to values in other hash | ||
fails:Hash#== compares values with == semantics |
@@ -1,12 +1,13 @@ | ||
class TestExecutionContext(object): | ||
def test_recursion_guard(self, space): | ||
f = "my_func" | ||
x = object() | ||
y = object() | ||
with space.getexecutioncontext().recursion_guard(x) as in_recursion: | ||
with space.getexecutioncontext().recursion_guard(f, x) as in_recursion: | ||
assert not in_recursion | ||
with space.getexecutioncontext().recursion_guard(y) as ir2: | ||
with space.getexecutioncontext().recursion_guard(f, y) as ir2: | ||
assert not ir2 | ||
with space.getexecutioncontext().recursion_guard(x) as ir3: | ||
with space.getexecutioncontext().recursion_guard(f, x) as ir3: | ||
assert ir3 | ||
with space.getexecutioncontext().recursion_guard(x) as ir3: | ||
with space.getexecutioncontext().recursion_guard(f, x) as ir3: | ||
assert ir3 |