diff options
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() |