'Tests that the error counter works as expected.'

def testCountErrors(self):

    truth_str = 'farm    barn'
    counts = ec.CountErrors(ocr_text=truth_str, truth_text=truth_str)
    self.assertEqual(counts, ec.ErrorCounts(fn=0, fp=0, truth_count=9, test_count=9))
    dot_str = 'farm    barn.'
    counts = ec.CountErrors(ocr_text=dot_str, truth_text=truth_str)
    self.assertEqual(counts, ec.ErrorCounts(fn=0, fp=1, truth_count=9, test_count=10))
    counts = ec.CountErrors(ocr_text=truth_str, truth_text=dot_str)
    self.assertEqual(counts, ec.ErrorCounts(fn=1, fp=0, truth_count=10, test_count=9))
    no_space = 'farmbarn'
    counts = ec.CountErrors(ocr_text=no_space, truth_text=truth_str)
    self.assertEqual(counts, ec.ErrorCounts(fn=1, fp=0, truth_count=9, test_count=8))
    counts = ec.CountErrors(ocr_text=truth_str, truth_text=no_space)
    self.assertEqual(counts, ec.ErrorCounts(fn=0, fp=1, truth_count=8, test_count=9))
    counts = ec.CountErrors(ocr_text='', truth_text=truth_str)
    self.assertEqual(counts, ec.ErrorCounts(fn=9, fp=0, truth_count=9, test_count=0))
    counts = ec.CountErrors(ocr_text=truth_str, truth_text='')
    self.assertEqual(counts, ec.ErrorCounts(fn=0, fp=9, truth_count=0, test_count=9))
