summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node/NodeTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-04-12 10:52:50 (GMT)
committerSteven Knight <knight@baldmt.com>2003-04-12 10:52:50 (GMT)
commit5e229b4f577acd2a89196c74196997d2a6f017cc (patch)
treefaf99f3ad74bbc39c45e4897f94318afea0a11a8 /src/engine/SCons/Node/NodeTests.py
parent864888601110b99b76ed83958bc370b12d3656ad (diff)
downloadSCons-5e229b4f577acd2a89196c74196997d2a6f017cc.zip
SCons-5e229b4f577acd2a89196c74196997d2a6f017cc.tar.gz
SCons-5e229b4f577acd2a89196c74196997d2a6f017cc.tar.bz2
Add a clear() method to reset a Node's state for re-processing.
Diffstat (limited to 'src/engine/SCons/Node/NodeTests.py')
-rw-r--r--src/engine/SCons/Node/NodeTests.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py
index 9da74d3..45c4af9 100644
--- a/src/engine/SCons/Node/NodeTests.py
+++ b/src/engine/SCons/Node/NodeTests.py
@@ -889,6 +889,26 @@ class NodeTestCase(unittest.TestCase):
finally:
SCons.Node.Annotate = save_Annotate
+ def test_clear(self):
+ """Test clearing all cached state information."""
+ n = SCons.Node.Node()
+
+ n.set_state(3)
+ n.set_bsig('bsig')
+ n.set_csig('csig')
+ n.includes = 'testincludes'
+ n.found_include = {'testkey':'testvalue'}
+ n.implicit = 'testimplicit'
+
+ n.clear()
+
+ assert n.get_state() is None, n.get_state()
+ assert not hasattr(n, 'bsig'), n.bsig
+ assert not hasattr(n, 'csig'), n.csig
+ assert n.includes is None, n.includes
+ assert n.found_includes == {}, n.found_includes
+ assert n.implicit is None, n.implicit
+
if __name__ == "__main__":
suite = unittest.makeSuite(NodeTestCase, 'test_')