Update final char case and unit test for #44.

This commit is contained in:
Donne Martin 2016-02-09 07:20:07 -05:00
parent af2f461239
commit fe4c118812

View File

@ -108,7 +108,7 @@
" result += prev_char + (str(count) if count > 1 else '')\n",
" prev_char = char\n",
" count = 1\n",
" result += prev_char + str(count)\n",
" result += prev_char + (str(count) if count > 1 else '')\n",
" return result if len(result) < len(string) else string"
]
},
@ -145,7 +145,7 @@
" assert_equal(func(None), None)\n",
" assert_equal(func(''), '')\n",
" assert_equal(func('AABBCC'), 'AABBCC')\n",
" assert_equal(func('AAABCCDDDD'), 'A3BC2D4')\n",
" assert_equal(func('AAABCCDDDDE'), 'A3BC2D4E')\n",
" print('Success: test_compress')\n",
"\n",
"\n",