def test_delete_comments(self): cases = ( ("//Pinguino Rules!", ""), ("/*Pinguino Rules!*/", ""), ("/*Pinguino //Rules!*/", ""), ("///*Pinguino Rules!*/", ""), ("\n".join([ "#define LED1 0\n", "//#define LED2 1\n", "/*\n", "1\n", "2\n", "3\n", "*/\n", "#include <math.h>\n", ]), "\n".join([ "#define LED1 0\n", "\n", "\n", "\n", "\n", "\n", "\n", "#include <math.h>\n", ]), ) ) for case in cases: got = Pinguino.remove_comments(case[0]) expected = case[1] self.assertMultiLineEqual(got, expected, "Remove comments: Failure\ngot: '%s'\nexpected: '%s'"%(got, expected))