diff options
author | Russel Winder <russel@winder.org.uk> | 2017-08-08 06:21:01 (GMT) |
---|---|---|
committer | Russel Winder <russel@winder.org.uk> | 2017-08-08 06:21:01 (GMT) |
commit | 060cedbd03a5e3cf30ad1668d6d2d32e5be2255f (patch) | |
tree | 6deea5fdcc40f110757c4d5f2ce83cb3bfe62d35 /src/engine/SCons/SubstTests.py | |
parent | 9a64b602e8cea77e7e747178248e2cbc483f85be (diff) | |
parent | 90f842616029050abffdabec078fe9a1f1b1d1a9 (diff) | |
download | SCons-060cedbd03a5e3cf30ad1668d6d2d32e5be2255f.zip SCons-060cedbd03a5e3cf30ad1668d6d2d32e5be2255f.tar.gz SCons-060cedbd03a5e3cf30ad1668d6d2d32e5be2255f.tar.bz2 |
Update to mainline.
Diffstat (limited to 'src/engine/SCons/SubstTests.py')
-rw-r--r-- | src/engine/SCons/SubstTests.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/engine/SCons/SubstTests.py b/src/engine/SCons/SubstTests.py index c11f247..6604128 100644 --- a/src/engine/SCons/SubstTests.py +++ b/src/engine/SCons/SubstTests.py @@ -183,6 +183,9 @@ class SubstTestCase(unittest.TestCase): 'HHH' : 'III', 'FFFIII' : 'BADNEWS', + 'THING1' : "$(STUFF$)", + 'THING2' : "$THING1", + 'LITERAL' : TestLiteral("$XXX"), # Test that we can expand to and return a function. @@ -405,6 +408,11 @@ class scons_subst_TestCase(SubstTestCase): "test", "test", + "test $( $THING2 $)", + "test $( $(STUFF$) $)", + "test STUFF", + "test", + "$AAA ${AAA}A $BBBB $BBB", "a aA b", "a aA b", @@ -544,6 +552,23 @@ class scons_subst_TestCase(SubstTestCase): else: raise AssertionError("did not catch expected UserError") + def test_subst_balance_errors(self): + """Test scons_subst(): handling syntax errors""" + env = DummyEnv(self.loc) + try: + scons_subst('$(', env, mode=SUBST_SIG) + except SCons.Errors.UserError as e: + assert str(e) == "Unbalanced $(/$) in: $(", str(e) + else: + raise AssertionError("did not catch expected UserError") + + try: + scons_subst('$)', env, mode=SUBST_SIG) + except SCons.Errors.UserError as e: + assert str(e) == "Unbalanced $(/$) in: $)", str(e) + else: + raise AssertionError("did not catch expected UserError") + def test_subst_type_errors(self): """Test scons_subst(): handling type errors""" env = DummyEnv(self.loc) |