diff --git a/arrays_strings/reverse_string/reverse_string_challenge.ipynb b/arrays_strings/reverse_string/reverse_string_challenge.ipynb index 499a0de..5fb4f89 100644 --- a/arrays_strings/reverse_string/reverse_string_challenge.ipynb +++ b/arrays_strings/reverse_string/reverse_string_challenge.ipynb @@ -121,10 +121,17 @@ " ['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", + " assert_equal(target_list, ['r', 'a', 'b', ' ', 'o', 'o', 'f'])\n", + " print('Success: test_reverse_inplace')\n", + "\n", "\n", "def main():\n", " test = TestReverse()\n", " test.test_reverse()\n", + " test.test_reverse_inplace()\n", "\n", "\n", "if __name__ == '__main__':\n", diff --git a/arrays_strings/reverse_string/reverse_string_solution.ipynb b/arrays_strings/reverse_string/reverse_string_solution.ipynb index 73c3325..9658372 100644 --- a/arrays_strings/reverse_string/reverse_string_solution.ipynb +++ b/arrays_strings/reverse_string/reverse_string_solution.ipynb @@ -170,10 +170,17 @@ " ['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", + " assert_equal(target_list, ['r', 'a', 'b', ' ', 'o', 'o', 'f'])\n", + " print('Success: test_reverse_inplace')\n", + "\n", "\n", "def main():\n", " test = TestReverse()\n", " test.test_reverse()\n", + " test.test_reverse_inplace()\n", "\n", "\n", "if __name__ == '__main__':\n", @@ -191,7 +198,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Success: test_reverse\n" + "Success: test_reverse\n", + "Success: test_reverse_inplace\n" ] } ], @@ -281,21 +289,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.10" + "pygments_lexer": "ipython3", + "version": "3.4.3" } }, "nbformat": 4, diff --git a/arrays_strings/reverse_string/test_reverse_string.py b/arrays_strings/reverse_string/test_reverse_string.py index 688bff7..553d5b3 100644 --- a/arrays_strings/reverse_string/test_reverse_string.py +++ b/arrays_strings/reverse_string/test_reverse_string.py @@ -11,10 +11,17 @@ class TestReverse(object): ['r', 'a', 'b', ' ', 'o', 'o', 'f']) print('Success: test_reverse') + def test_reverse_inplace(self): + target_list = ['f', 'o', 'o', ' ', 'b', 'a', 'r'] + list_of_chars(target_list) + assert_equal(target_list, ['r', 'a', 'b', ' ', 'o', 'o', 'f']) + print('Success: test_reverse_inplace') + def main(): test = TestReverse() test.test_reverse() + test.test_reverse_inplace() if __name__ == '__main__':