diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2008-09-18 03:07:41 (GMT) |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2008-09-18 03:07:41 (GMT) |
commit | 1b9e7a4527c5c75413b82b66b9a17594f75ac667 (patch) | |
tree | b049a00bdcca884605ee15bf1a2f00f789a97d09 /src/engine/SCons/UtilTests.py | |
parent | aee3c77a33763e5665d57e2048102416c4172423 (diff) | |
download | SCons-1b9e7a4527c5c75413b82b66b9a17594f75ac667.zip SCons-1b9e7a4527c5c75413b82b66b9a17594f75ac667.tar.gz SCons-1b9e7a4527c5c75413b82b66b9a17594f75ac667.tar.bz2 |
Fix issue #2091 by adding new delete_existing flags to Util.{Ap,Pre}pendPath and env.{Ap,Pre}pendENVPath.
Diffstat (limited to 'src/engine/SCons/UtilTests.py')
-rw-r--r-- | src/engine/SCons/UtilTests.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py index 8a24ef1..a27f8c3 100644 --- a/src/engine/SCons/UtilTests.py +++ b/src/engine/SCons/UtilTests.py @@ -478,6 +478,22 @@ class UtilTestCase(unittest.TestCase): assert(p1 == r'C:\dir\num\one;C:\dir\num\two;C:\dir\num\three') assert(p2 == r'C:\mydir\num\two;C:\mydir\num\three;C:\mydir\num\one') + def test_PrependPathPreserveOld(self): + """Test prepending to a path while preserving old paths""" + p1 = r'C:\dir\num\one;C:\dir\num\two' + # have to include the pathsep here so that the test will work on UNIX too. + p1 = PrependPath(p1,r'C:\dir\num\two',sep = ';', delete_existing=0) + p1 = PrependPath(p1,r'C:\dir\num\three',sep = ';') + assert(p1 == r'C:\dir\num\three;C:\dir\num\one;C:\dir\num\two') + + def test_AppendPathPreserveOld(self): + """Test appending to a path while preserving old paths""" + p1 = r'C:\dir\num\one;C:\dir\num\two' + # have to include the pathsep here so that the test will work on UNIX too. + p1 = AppendPath(p1,r'C:\dir\num\one',sep = ';', delete_existing=0) + p1 = AppendPath(p1,r'C:\dir\num\three',sep = ';') + assert(p1 == r'C:\dir\num\one;C:\dir\num\two;C:\dir\num\three') + def test_NodeList(self): """Test NodeList class""" class TestClass: |