def test_rle_encode_improved_single_multiple_digits(self): self.assertEqual('412a-62121212b-21b', compress.rle_encode_improved('1111aa212121bb1b'))
def test_rle_encode_improved_single_char(self): self.assertEqual('-21a', compress.rle_encode_improved('1a'))
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'))
def test_rle_encode_improved_input(self): self.assertEqual(compress.rle_encode_improved('aaabccccCCaB'), '3a1b4c2C-2aB')
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)