def test_makefile(self):
    out = StringIO()
    mk = Makefile()
    rule = mk.create_rule(['foo'])
    rule.add_dependencies(['bar', 'baz', 'qux'])
    rule.add_commands(['echo foo'])
    rule = mk.create_rule().add_targets(['bar', 'baz'])
    rule.add_dependencies(['hoge'])
    rule.add_commands(['echo $@'])
    mk.dump(out, removal_guard=False)
    self.assertEqual(out.getvalue(), ((('foo: bar baz qux\n' + '\techo foo\n') + 'bar baz: hoge\n') + '\techo $@\n'))
    out.truncate(0)
    mk.dump(out)
    self.assertEqual(out.getvalue(), (((('foo: bar baz qux\n' + '\techo foo\n') + 'bar baz: hoge\n') + '\techo $@\n') + 'hoge qux:\n'))
def test_makefile(self):
    out = StringIO()
    mk = Makefile()
    rule = mk.create_rule(['foo'])
    rule.add_dependencies(['bar', 'baz', 'qux'])
    rule.add_commands(['echo foo'])
    rule = mk.create_rule().add_targets(['bar', 'baz'])
    rule.add_dependencies(['hoge'])
    rule.add_commands(['echo $@'])
    mk.dump(out, removal_guard=False)
    self.assertEqual(out.getvalue(), ((('foo: bar baz qux\n' + '\techo foo\n') + 'bar baz: hoge\n') + '\techo $@\n'))
    out.truncate(0)
    mk.dump(out)
    self.assertEqual(out.getvalue(), (((('foo: bar baz qux\n' + '\techo foo\n') + 'bar baz: hoge\n') + '\techo $@\n') + 'hoge qux:\n'))