diff options
author | Evan Jones <ej@evanjones.ca> | 2012-01-04 19:58:42 (GMT) |
---|---|---|
committer | Evan Jones <ej@evanjones.ca> | 2012-01-04 22:36:08 (GMT) |
commit | 16e4419e88925b82c1158fcfbbb78c2e30f91905 (patch) | |
tree | dec8e6fcfe6e98e1541697e32b1c8b8b486f8acf /misc/ninja_test.py | |
parent | b12139c13e8924ce4d0e634f5798274a5d87f5d7 (diff) | |
download | Ninja-16e4419e88925b82c1158fcfbbb78c2e30f91905.zip Ninja-16e4419e88925b82c1158fcfbbb78c2e30f91905.tar.gz Ninja-16e4419e88925b82c1158fcfbbb78c2e30f91905.tar.bz2 |
ninja_syntax.py: Fix a bug when passing dict variables to Writer.build()
Add a test to cover both dict and list variables.
Diffstat (limited to 'misc/ninja_test.py')
-rwxr-xr-x | misc/ninja_test.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/misc/ninja_test.py b/misc/ninja_test.py index 65dbec6..897de72 100755 --- a/misc/ninja_test.py +++ b/misc/ninja_test.py @@ -111,5 +111,26 @@ foo = a$$ $ ''', self.out.getvalue()) +class TestBuild(unittest.TestCase): + def setUp(self): + self.out = StringIO() + self.n = ninja_syntax.Writer(self.out) + + def test_variables_dict(self): + self.n.build('out', 'cc', 'in', variables={'name': 'value'}) + self.assertEqual('''\ +build out: cc in + name = value +''', + self.out.getvalue()) + + def test_variables_list(self): + self.n.build('out', 'cc', 'in', variables=[('name', 'value')]) + self.assertEqual('''\ +build out: cc in + name = value +''', + self.out.getvalue()) + if __name__ == '__main__': unittest.main() |