Rename list_of_chars to reverse_string.

This commit is contained in:
Donne Martin
2016-02-14 06:04:48 -05:00
parent 27a0bf786e
commit 21add6f4f5
3 changed files with 19 additions and 19 deletions

View File

@@ -94,7 +94,7 @@
"from __future__ import division\n",
"\n",
"\n",
"def list_of_chars(chars):\n",
"def reverse_string(chars):\n",
" if chars is None:\n",
" return None\n",
" size = len(chars)\n",
@@ -163,16 +163,16 @@
"class TestReverse(object):\n",
"\n",
" def test_reverse(self):\n",
" assert_equal(list_of_chars(None), None)\n",
" assert_equal(list_of_chars(['']), [''])\n",
" assert_equal(list_of_chars(\n",
" assert_equal(reverse_string(None), None)\n",
" assert_equal(reverse_string(['']), [''])\n",
" assert_equal(reverse_string(\n",
" ['f', 'o', 'o', ' ', 'b', 'a', 'r']),\n",
" ['r', 'a', 'b', ' ', 'o', 'o', 'f'])\n",
" print('Success: test_reverse')\n",
"\n",
" def test_reverse_inplace(self):\n",
" target_list = ['f', 'o', 'o', ' ', 'b', 'a', 'r']\n",
" list_of_chars(target_list)\n",
" reverse_string(target_list)\n",
" assert_equal(target_list, ['r', 'a', 'b', ' ', 'o', 'o', 'f'])\n",
" print('Success: test_reverse_inplace')\n",
"\n",