def testParseLineComment(self): """parse_line on a line with a comment only""" for commentstring in self.commentsOnly: self.subtest = commentstring func, args, comment = cmakegrammar.parse_line(commentstring) self.assertEqual((func, args, comment), ("", None, commentstring))
def testParseLineMixed(self): """parse_line on a line with both a command and a comment""" for (line, expected) in self.mixed: self.subtest = line func, args, comment = cmakegrammar.parse_line(line) self.assertEqual((func, args, comment), expected)
def testParseLineCommand(self): """parse_line on a line with a command only""" for (line, expected) in self.commandsOnly: self.subtest = line func, args, comment = cmakegrammar.parse_line(line) self.assertEqual((func, args, comment), expected)
def testHandleEOFSentry(self): """Parsing None as your line results in an all-None tuple""" self.assertEqual(cmakegrammar.parse_line(None), (None, None, None))