summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-06-11 10:30:52 (GMT)
committerSteven Knight <knight@baldmt.com>2003-06-11 10:30:52 (GMT)
commita4c2fbc5c38a747636544213bd42bdf9b1eada32 (patch)
treea4f76fb422ec39bb1fbb0f42b1f6f39564c0865c /src/engine
parentc6f1c79f88056176cc2d1567521177744f79b569 (diff)
downloadSCons-a4c2fbc5c38a747636544213bd42bdf9b1eada32.zip
SCons-a4c2fbc5c38a747636544213bd42bdf9b1eada32.tar.gz
SCons-a4c2fbc5c38a747636544213bd42bdf9b1eada32.tar.bz2
Fix _concat() documentation, add a test. (Chad Austin)
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/EnvironmentTests.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index d8b4f9d..3da8334 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -544,6 +544,23 @@ class EnvironmentTestCase(unittest.TestCase):
assert i.__class__.__name__ == 'File'
assert i.path == 'dep.py'
+ def test_AlwaysBuild(self):
+ """Test the AlwaysBuild() method"""
+ env = Environment()
+ t = env.AlwaysBuild('a', 'b', ['c', 'd'])
+ assert t[0].__class__.__name__ == 'File'
+ assert t[0].path == 'a'
+ assert t[0].always_build
+ assert t[1].__class__.__name__ == 'File'
+ assert t[1].path == 'b'
+ assert t[1].always_build
+ assert t[2].__class__.__name__ == 'File'
+ assert t[2].path == 'c'
+ assert t[2].always_build
+ assert t[3].__class__.__name__ == 'File'
+ assert t[3].path == 'd'
+ assert t[3].always_build
+
def test_Precious(self):
"""Test the Precious() method."""
env = Environment()
@@ -878,6 +895,16 @@ class EnvironmentTestCase(unittest.TestCase):
x = env.get('bbb', 'XXX')
assert x == 'XXX', x
+ def test_concat(self):
+ "Test _concat()"
+ e1 = Environment(PRE='pre', SUF='suf', STR='a b', LIST=['a', 'b'])
+ s = e1.subst
+ assert s("${_concat('', '', '', __env__)}") == ''
+ assert s("${_concat('', [], '', __env__)}") == ''
+ assert s("${_concat(PRE, '', SUF, __env__)}") == ''
+ assert s("${_concat(PRE, STR, SUF, __env__)}") == 'prea bsuf'
+ assert s("${_concat(PRE, LIST, SUF, __env__)}") == 'preasuf prebsuf'
+
def test_FindIxes(self):
"Test FindIxes()"
env = Environment(LIBPREFIX='lib',