예제 #1
0
 def test1(self):
     """Should handle simple tests"""
     self.assertEqual(main.first_non_repeating_letter('a'), 'a')
     self.assertEqual(main.first_non_repeating_letter('stress'), 't')
     self.assertEqual(main.first_non_repeating_letter('moonmen'), 'e')
예제 #2
0
 def test5(self):
     """Should handle letter cases"""
     self.assertEqual(main.first_non_repeating_letter('sTreSS'), 'T')
     self.assertEqual(
         main.first_non_repeating_letter(
             'Go hang a salami, I\'m a lasagna hog!'), ',')
예제 #3
0
 def test3(self):
     """Should handle all repeating strings"""
     self.assertEqual(main.first_non_repeating_letter('abba'), '')
     self.assertEqual(main.first_non_repeating_letter('aa'), '')
예제 #4
0
 def test4(self):
     """Should handle odd characters"""
     self.assertEqual(main.first_non_repeating_letter('~><#~><'), '#')
     self.assertEqual(main.first_non_repeating_letter('hello world, eh?'),
                      'w')
예제 #5
0
 def test2(self):
     """Should handle empty strings"""
     self.assertEqual(main.first_non_repeating_letter(''), '')