Exemple #1
0
 def test_rle_encode_improved_single_multiple_digits(self):
     self.assertEqual('412a-62121212b-21b',
                      compress.rle_encode_improved('1111aa212121bb1b'))
Exemple #2
0
 def test_rle_encode_improved_single_char(self):
     self.assertEqual('-21a', compress.rle_encode_improved('1a'))
Exemple #3
0
 def test_rle_encode_improved_nonletter(self):
     self.assertEqual('-4ab b', compress.rle_encode_improved('ab b'))
     self.assertEqual('1a2b', compress.rle_encode_improved('abb\0\0'))
Exemple #4
0
 def test_rle_encode_improved_input(self):
     self.assertEqual(compress.rle_encode_improved('aaabccccCCaB'),
                      '3a1b4c2C-2aB')
Exemple #5
0
 def test_rle_encode_improved_improved(self):
     actual = compress.rle_encode_improved(
         '#########....#.###.#.#.##..#...#########')
     self.assertEqual('9#4.-2#.3#-5.#.#.2#2.1#3.9#', actual)