示例#1
0
 def test_zero_newlines(self):
     self.assertEqual(
         _count_newlines_from_end(
             u'The quick brown fox jumped over the lazy dog' * 1000), 0)
示例#2
0
 def test_multiple_newlines(self):
     self.assertEqual(
         _count_newlines_from_end(
             u'The quick brown fox jumped over the lazy dog' * 1000 +
             u'\n\n\n'), 3)
示例#3
0
 def test_short_string(self):
     self.assertEqual(_count_newlines_from_end(u'The quick\n'), 1)
示例#4
0
 def test_zero_length_string(self):
     self.assertEqual(_count_newlines_from_end(u''), 0)
示例#5
0
 def test_mostly_newlines(self):
     self.assertEqual(
         _count_newlines_from_end(
             u'The quick brown fox jumped over the lazy dog' +
             u'\n' * 1000), 1000)
示例#6
0
 def test_all_newlines(self):
     self.assertEqual(_count_newlines_from_end(u'\n' * 10), 10)