Update remove dupes unit test to handle more cases.

This commit is contained in:
Donne Martin 2016-02-10 06:33:30 -05:00
parent 71cb434de7
commit 27a0bf786e
3 changed files with 19 additions and 10 deletions

View File

@ -141,6 +141,9 @@
"\n", "\n",
" print('Test: General case, duplicates')\n", " print('Test: General case, duplicates')\n",
" linked_list.insert_to_front(1)\n", " linked_list.insert_to_front(1)\n",
" linked_list.insert_to_front(1)\n",
" linked_list.insert_to_front(3)\n",
" linked_list.insert_to_front(2)\n",
" linked_list.insert_to_front(3)\n", " linked_list.insert_to_front(3)\n",
" linked_list.insert_to_front(1)\n", " linked_list.insert_to_front(1)\n",
" linked_list.insert_to_front(1)\n", " linked_list.insert_to_front(1)\n",
@ -176,21 +179,21 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 2", "display_name": "Python 3",
"language": "python", "language": "python",
"name": "python2" "name": "python3"
}, },
"language_info": { "language_info": {
"codemirror_mode": { "codemirror_mode": {
"name": "ipython", "name": "ipython",
"version": 2 "version": 3
}, },
"file_extension": ".py", "file_extension": ".py",
"mimetype": "text/x-python", "mimetype": "text/x-python",
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython2", "pygments_lexer": "ipython3",
"version": "2.7.10" "version": "3.4.3"
} }
}, },
"nbformat": 4, "nbformat": 4,

View File

@ -191,6 +191,9 @@
"\n", "\n",
" print('Test: General case, duplicates')\n", " print('Test: General case, duplicates')\n",
" linked_list.insert_to_front(1)\n", " linked_list.insert_to_front(1)\n",
" linked_list.insert_to_front(1)\n",
" linked_list.insert_to_front(3)\n",
" linked_list.insert_to_front(2)\n",
" linked_list.insert_to_front(3)\n", " linked_list.insert_to_front(3)\n",
" linked_list.insert_to_front(1)\n", " linked_list.insert_to_front(1)\n",
" linked_list.insert_to_front(1)\n", " linked_list.insert_to_front(1)\n",
@ -241,21 +244,21 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 2", "display_name": "Python 3",
"language": "python", "language": "python",
"name": "python2" "name": "python3"
}, },
"language_info": { "language_info": {
"codemirror_mode": { "codemirror_mode": {
"name": "ipython", "name": "ipython",
"version": 2 "version": 3
}, },
"file_extension": ".py", "file_extension": ".py",
"mimetype": "text/x-python", "mimetype": "text/x-python",
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython2", "pygments_lexer": "ipython3",
"version": "2.7.10" "version": "3.4.3"
} }
}, },
"nbformat": 4, "nbformat": 4,

View File

@ -15,6 +15,9 @@ class TestRemoveDupes(object):
print('Test: General case, duplicates') print('Test: General case, duplicates')
linked_list.insert_to_front(1) linked_list.insert_to_front(1)
linked_list.insert_to_front(1)
linked_list.insert_to_front(3)
linked_list.insert_to_front(2)
linked_list.insert_to_front(3) linked_list.insert_to_front(3)
linked_list.insert_to_front(1) linked_list.insert_to_front(1)
linked_list.insert_to_front(1) linked_list.insert_to_front(1)