def shortDescription(self): return'%s test of "%s"' % (self.__class__.__name__, self.filename)
class OkTestCase(IPDLTestCase): """An invocation of the IPDL compiler on a valid specification.
The IPDL compiler should not produce errors or exceptions."""
class ErrorTestCase(IPDLTestCase): """An invocation of the IPDL compiler on an *invalid* specification.
The IPDL compiler *should* produce errors but not exceptions."""
# Look for expected errors in the input file.
f = open(filename, "r")
self.expectedErrorMessage = [] for l in f: if l.startswith("//error:"):
self.expectedErrorMessage.append(l[2:-1])
f.close()
def checkPassed(self):
self.assertNotEqual(
self.expectedErrorMessage,
[],
self.mkCustomMsg( "Error test should contain at least "
+ "one line starting with //error: "
+ "that indicates the expected failure."
),
)
for e in self.expectedErrorMessage:
self.assertTrue(
self.compile.error(e),
self.mkCustomMsg('Did not see expected error "' + e + '"'),
)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.