Example #1
0
 def testEmptySubmission(self):
     master = "not empty"
     sub = ""
     self.assertEqual(typer.evaluate_line(master, sub), 9)
Example #2
0
 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)
Example #3
0
 def testTest(self):
     master = "123456789  "
     sub = "123456654 "
     self.assertEqual(typer.evaluate_line(master, master), 0)
Example #4
0
 def testEmptyMaster(self):
     master = ""
     submission = "furtive"
     self.assertEqual(typer.evaluate_line(master, submission), 7)
Example #5
0
 def testDoubleTypo(self):
     master = "Too many pennies in Heaven"
     sub = "Too many ol[pennies in Heaven"
     self.assertEqual(typer.evaluate_line(master, sub), 3)
Example #6
0
 def testBothEmpty(self):
     master = ""
     self.assertEqual(typer.evaluate_line(master, master), 0)
Example #7
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)
Example #8
0
 def testTooShort(self):
     master = "Authorities seldom signify sacrilege"
     sub = "Authorities seldom signify"
     self.assertEqual(typer.evaluate_line(master, sub), 10)
Example #9
0
 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)
Example #10
0
 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)
Example #11
0
 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)
Example #12
0
 def testTypo(self):
     master = "this text is speedy!"
     sub = "this test is speedy!"
     self.assertEqual(typer.evaluate_line(master, sub), 1)
Example #13
0
 def testAccurate(self):
     master = "here's some very simple text with no typos"
     self.assertEqual(typer.evaluate_line(master, master), 0)