def testEmptySubmission(self): master = "not empty" sub = "" self.assertEqual(typer.evaluate_line(master, sub), 9)
def testGreedyAlgorithmFailure(self): # My custom-written algorithm failed this test # Levenshtein distance passes this test master = "this text has spaces" sub = " this text has spaces" self.assertEqual(typer.evaluate_line(master, sub), 8)
def testTest(self): master = "123456789 " sub = "123456654 " self.assertEqual(typer.evaluate_line(master, master), 0)
def testEmptyMaster(self): master = "" submission = "furtive" self.assertEqual(typer.evaluate_line(master, submission), 7)
def testDoubleTypo(self): master = "Too many pennies in Heaven" sub = "Too many ol[pennies in Heaven" self.assertEqual(typer.evaluate_line(master, sub), 3)
def testBothEmpty(self): master = "" self.assertEqual(typer.evaluate_line(master, master), 0)
def testTooLong(self): master = "don't believe everything you think" sub = "don't believe everything you think, buddy" self.assertEqual(typer.evaluate_line(master, sub), 7)
def testTooShort(self): master = "Authorities seldom signify sacrilege" sub = "Authorities seldom signify" self.assertEqual(typer.evaluate_line(master, sub), 10)
def testSeveralTypos(self): master = "Once again we find ourselves in Spain" sub = "One againwe find ourselves in spain" self.assertEqual(typer.evaluate_line(master, sub), 3)
def testDoubleType(self): master = "Forever new, the sky glows with abandon" sub = "Forever neww, the sky glows with abandon" self.assertEqual(typer.evaluate_line(master, sub), 1)
def testSkipped(self): master = "who grew two blue shoes for you?" sub = "who grew two blue shoes fr you?" self.assertEqual(typer.evaluate_line(master, sub), 1)
def testTypo(self): master = "this text is speedy!" sub = "this test is speedy!" self.assertEqual(typer.evaluate_line(master, sub), 1)
def testAccurate(self): master = "here's some very simple text with no typos" self.assertEqual(typer.evaluate_line(master, master), 0)