summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/SubstTests.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/SubstTests.py')
-rw-r--r--src/engine/SCons/SubstTests.py25
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)