summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/EnvironmentTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-12-13 04:42:05 (GMT)
committerSteven Knight <knight@baldmt.com>2001-12-13 04:42:05 (GMT)
commitc81b4be9b7a06dc41cc1f425887d4600fa47f0bc (patch)
treea800b193675c98825b6af007b88b1fb51c41c3e4 /src/engine/SCons/EnvironmentTests.py
parentb9f370f232001d693f10279a3bcff8a0e66eb303 (diff)
downloadSCons-c81b4be9b7a06dc41cc1f425887d4600fa47f0bc.zip
SCons-c81b4be9b7a06dc41cc1f425887d4600fa47f0bc.tar.gz
SCons-c81b4be9b7a06dc41cc1f425887d4600fa47f0bc.tar.bz2
Bug fixes for Scanner handling of subdirectories and Environment copying, courtesy Charles Crain.
Diffstat (limited to 'src/engine/SCons/EnvironmentTests.py')
-rw-r--r--src/engine/SCons/EnvironmentTests.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index af9ccb7..3ba8ad4 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -159,6 +159,21 @@ class EnvironmentTestCase(unittest.TestCase):
assert env3.Dictionary('ZZZ') == 'z3'
assert env1 == env1copy
+ # Ensure that lists and dictionaries are
+ # deep copied, but not instances.
+ class TestA:
+ pass
+ env1 = Environment(XXX=TestA(), YYY = [ 1, 2, 3 ],
+ ZZZ = { 1:2, 3:4 })
+ env2=env1.Copy()
+ env2.Dictionary('YYY').append(4)
+ env2.Dictionary('ZZZ')[5] = 6
+ assert env1.Dictionary('XXX') is env2.Dictionary('XXX')
+ assert 4 in env2.Dictionary('YYY')
+ assert not 4 in env1.Dictionary('YYY')
+ assert env2.Dictionary('ZZZ').has_key(5)
+ assert not env1.Dictionary('ZZZ').has_key(5)
+
def test_Dictionary(self):
"""Test retrieval of known construction variables