From cd6798010fbc263b8a68a6f37fd75d3df8a5d36d Mon Sep 17 00:00:00 2001 From: Donne Martin Date: Sun, 21 Jun 2015 17:23:41 -0400 Subject: [PATCH] Tweaked unit test to allow for passing of function to execute. Removed calling of tests for non-in-place solutions, will revisit in the future. --- arrays-strings/replace_char.ipynb | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arrays-strings/replace_char.ipynb b/arrays-strings/replace_char.ipynb index d1d11cd..4bfb436 100644 --- a/arrays-strings/replace_char.ipynb +++ b/arrays-strings/replace_char.ipynb @@ -60,10 +60,10 @@ " str1 = bytearray(' ||')\n", " str2 = bytearray(' foo bar ||||||')\n", " str3 = bytearray('foo')\n", - " encode_spaces(str0, 0)\n", - " encode_spaces(str1, 1)\n", - " encode_spaces(str2, 9)\n", - " encode_spaces(str3, 3)\n", + " func(str0, 0)\n", + " func(str1, 1)\n", + " func(str2, 9)\n", + " func(str3, 3)\n", " assert_equal(str0, None)\n", " assert_equal(str1, '%20')\n", " assert_equal(str2, '%20foo%20bar%20')\n", @@ -157,10 +157,7 @@ " return re.sub(' ', '%20', string)\n", "\n", "def encode_spaces_alt2(string):\n", - " return string.replace(' ', '%20')\n", - "\n", - "run_tests(encode_spaces_alt)\n", - "run_tests(encode_spaces_alt2)" + " return string.replace(' ', '%20')" ] } ],