143 |
seteq( f.f(nodes[0]) , [nodes[3]] ) |
seteq( f.f(nodes[0]) , [nodes[3]] ) |
144 |
|
|
145 |
|
|
146 |
|
def testSuperlazy3_doublecache_chg(): |
147 |
|
"""Test that a double cache works right. |
148 |
|
|
149 |
|
There used to be a bug where the entries in the smaller cache |
150 |
|
didn't chg() to the lower cache correctly. |
151 |
|
""" |
152 |
|
background = vob.util.ExplicitBackground() |
153 |
|
graph = ff.swamp.impl.HashGraph() |
154 |
|
functional = ff.functional.SuperFunctional1(graph, background) |
155 |
|
|
156 |
|
# Two normal caches |
157 |
|
functional.cache("A", 2, 0) |
158 |
|
functional.cache("B", 100, 0) |
159 |
|
|
160 |
|
nodes = [ff.swamp.Nodes.N() for i in range(0,10)] |
161 |
|
|
162 |
|
node = functional.createFunctionInstance( |
163 |
|
"A", |
164 |
|
ff.functional.FunctionalTest.TripleSet_Node, |
165 |
|
[ nodes[1] ] |
166 |
|
) |
167 |
|
node = functional.createFunctionInstance( |
168 |
|
"B", |
169 |
|
ff.functional.FunctionalTest.Identity_Node, |
170 |
|
[ node ] |
171 |
|
) |
172 |
|
f = node.getCallableFunction() |
173 |
|
|
174 |
|
# The latest one has to be the one to move |
175 |
|
for i in range(2, 7): |
176 |
|
seteq( f.f(nodes[i]) , [] ) |
177 |
|
|
178 |
|
for i in range(2, 7): |
179 |
|
graph.add(nodes[i], nodes[1], nodes[0]) |
180 |
|
|
181 |
|
for i in range(2, 7): |
182 |
|
seteq( f.f(nodes[i]) , [nodes[0]] ) |
183 |
|
|
184 |
|
|
185 |
|
|
186 |
|
|