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.

This commit is contained in:
Donne Martin 2015-06-21 17:23:41 -04:00
parent 4d1b78617a
commit cd6798010f

View File

@ -60,10 +60,10 @@
" str1 = bytearray(' ||')\n", " str1 = bytearray(' ||')\n",
" str2 = bytearray(' foo bar ||||||')\n", " str2 = bytearray(' foo bar ||||||')\n",
" str3 = bytearray('foo')\n", " str3 = bytearray('foo')\n",
" encode_spaces(str0, 0)\n", " func(str0, 0)\n",
" encode_spaces(str1, 1)\n", " func(str1, 1)\n",
" encode_spaces(str2, 9)\n", " func(str2, 9)\n",
" encode_spaces(str3, 3)\n", " func(str3, 3)\n",
" assert_equal(str0, None)\n", " assert_equal(str0, None)\n",
" assert_equal(str1, '%20')\n", " assert_equal(str1, '%20')\n",
" assert_equal(str2, '%20foo%20bar%20')\n", " assert_equal(str2, '%20foo%20bar%20')\n",
@ -157,10 +157,7 @@
" return re.sub(' ', '%20', string)\n", " return re.sub(' ', '%20', string)\n",
"\n", "\n",
"def encode_spaces_alt2(string):\n", "def encode_spaces_alt2(string):\n",
" return string.replace(' ', '%20')\n", " return string.replace(' ', '%20')"
"\n",
"run_tests(encode_spaces_alt)\n",
"run_tests(encode_spaces_alt2)"
] ]
} }
], ],