mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
Fix two sum unit_test challenge to match the solution notebook (#176)
This commit is contained in:
parent
d60f4a904c
commit
ffd4798f23
@ -122,8 +122,12 @@
|
||||
"\n",
|
||||
" def test_two_sum(self):\n",
|
||||
" solution = Solution()\n",
|
||||
" assert_raises(TypeError, solution.two_sum, None)\n",
|
||||
" assert_equal(solution.two_sum(0), 0)\n",
|
||||
" assert_raises(TypeError, solution.two_sum, None, None)\n",
|
||||
" assert_raises(ValueError, solution.two_sum, [], 0)\n",
|
||||
" target = 7\n",
|
||||
" nums = [1, 3, 2, -7, 5]\n",
|
||||
" expected = [2, 4]\n",
|
||||
" assert_equal(solution.two_sum(nums, target), expected)\n",
|
||||
" print('Success: test_two_sum')\n",
|
||||
"\n",
|
||||
"\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user