Skip to content

Commit 655d8eb

Browse files
authored
Merge pull request bloominstituteoftechnology#87 from nickcannariato/@nickcannariato-fix-sorting-nits
Resolve testing issues and update .gitignore
2 parents 592cf38 + b096dc0 commit 655d8eb

2 files changed

Lines changed: 202 additions & 6 deletions

File tree

‎.gitignore‎

Lines changed: 198 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,198 @@
1-
.DS_Store
1+
2+
# Created by https://www.gitignore.io/api/windows,macos,linux,python
3+
# Edit at https://www.gitignore.io/?templates=windows,macos,linux,python
4+
5+
### Linux ###
6+
*~
7+
8+
# temporary files which can be created if a process still has a handle open of a deleted file
9+
.fuse_hidden*
10+
11+
# KDE directory preferences
12+
.directory
13+
14+
# Linux trash folder which might appear on any partition or disk
15+
.Trash-*
16+
17+
# .nfs files are created when an open file is removed but is still being accessed
18+
.nfs*
19+
20+
### macOS ###
21+
# General
22+
.DS_Store
23+
.AppleDouble
24+
.LSOverride
25+
26+
# Icon must end with two \r
27+
Icon
28+
29+
# Thumbnails
30+
._*
31+
32+
# Files that might appear in the root of a volume
33+
.DocumentRevisions-V100
34+
.fseventsd
35+
.Spotlight-V100
36+
.TemporaryItems
37+
.Trashes
38+
.VolumeIcon.icns
39+
.com.apple.timemachine.donotpresent
40+
41+
# Directories potentially created on remote AFP share
42+
.AppleDB
43+
.AppleDesktop
44+
Network Trash Folder
45+
Temporary Items
46+
.apdisk
47+
48+
### Python ###
49+
# Byte-compiled / optimized / DLL files
50+
__pycache__/
51+
*.py[cod]
52+
*$py.class
53+
54+
# C extensions
55+
*.so
56+
57+
# Distribution / packaging
58+
.Python
59+
build/
60+
develop-eggs/
61+
dist/
62+
downloads/
63+
eggs/
64+
.eggs/
65+
lib/
66+
lib64/
67+
parts/
68+
sdist/
69+
var/
70+
wheels/
71+
pip-wheel-metadata/
72+
share/python-wheels/
73+
*.egg-info/
74+
.installed.cfg
75+
*.egg
76+
MANIFEST
77+
78+
# PyInstaller
79+
# Usually these files are written by a python script from a template
80+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
81+
*.manifest
82+
*.spec
83+
84+
# Installer logs
85+
pip-log.txt
86+
pip-delete-this-directory.txt
87+
88+
# Unit test / coverage reports
89+
htmlcov/
90+
.tox/
91+
.nox/
92+
.coverage
93+
.coverage.*
94+
.cache
95+
nosetests.xml
96+
coverage.xml
97+
*.cover
98+
.hypothesis/
99+
.pytest_cache/
100+
101+
# Translations
102+
*.mo
103+
*.pot
104+
105+
# Django stuff:
106+
*.log
107+
local_settings.py
108+
db.sqlite3
109+
110+
# Flask stuff:
111+
instance/
112+
.webassets-cache
113+
114+
# Scrapy stuff:
115+
.scrapy
116+
117+
# Sphinx documentation
118+
docs/_build/
119+
120+
# PyBuilder
121+
target/
122+
123+
# Jupyter Notebook
124+
.ipynb_checkpoints
125+
126+
# IPython
127+
profile_default/
128+
ipython_config.py
129+
130+
# pyenv
131+
.python-version
132+
133+
# pipenv
134+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
135+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
136+
# having no cross-platform support, pipenv may install dependencies that don’t work, or not
137+
# install all needed dependencies.
138+
#Pipfile.lock
139+
140+
# celery beat schedule file
141+
celerybeat-schedule
142+
143+
# SageMath parsed files
144+
*.sage.py
145+
146+
# Environments
147+
.env
148+
.venv
149+
env/
150+
venv/
151+
ENV/
152+
env.bak/
153+
venv.bak/
154+
155+
# Spyder project settings
156+
.spyderproject
157+
.spyproject
158+
159+
# Rope project settings
160+
.ropeproject
161+
162+
# mkdocs documentation
163+
/site
164+
165+
# mypy
166+
.mypy_cache/
167+
.dmypy.json
168+
dmypy.json
169+
170+
# Pyre type checker
171+
.pyre/
172+
173+
### Windows ###
174+
# Windows thumbnail cache files
175+
Thumbs.db
176+
ehthumbs.db
177+
ehthumbs_vista.db
178+
179+
# Dump file
180+
*.stackdump
181+
182+
# Folder config file
183+
[Dd]esktop.ini
184+
185+
# Recycle Bin used on file shares
186+
$RECYCLE.BIN/
187+
188+
# Windows Installer files
189+
*.cab
190+
*.msi
191+
*.msix
192+
*.msm
193+
*.msp
194+
195+
# Windows shortcuts
196+
*.lnk
197+
198+
# End of https://www.gitignore.io/api/windows,macos,linux,python

‎src/searching/test_searching.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import unittest
22
from searching import *
33

4+
45
class SearchingTests(unittest.TestCase):
56
def test_linear_search(self):
67
arr1 = [-2, 7, 3, -9, 5, 1, 0, 4, -6]
@@ -11,19 +12,17 @@ def test_linear_search(self):
1112
self.assertEqual(linear_search(arr1, 0), 6)
1213
self.assertEqual(linear_search(arr2, 3), -1)
1314

14-
1515
def test_binary_search(self):
16-
arr1 = [-9, -8, -6, -4, -3, -2, 0, 1, 2, 3, 5, 7, 8, 9]
16+
arr1 = [-9, -8, -6, -4, -3, -2, 0, 1, 2, 3, 5, 7, 8, 9]
1717
arr2 = []
1818

1919
self.assertEqual(binary_search(arr1, -8), 1)
2020
self.assertEqual(binary_search(arr1, 0), 6)
2121
self.assertEqual(binary_search(arr2, 6), -1)
2222
self.assertEqual(binary_search(arr2, 0), -1)
2323

24-
2524
def test_binary_search_recursive(self):
26-
arr1 = [-9, -8, -6, -4, -3, -2, 0, 1, 2, 3, 5, 7, 8, 9]
25+
arr1 = [-9, -8, -6, -4, -3, -2, 0, 1, 2, 3, 5, 7, 8, 9]
2726
arr2 = []
2827

2928
self.assertEqual(binary_search_recursive(arr1, -8, 0, len(arr1)-1), 1)
@@ -33,4 +32,4 @@ def test_binary_search_recursive(self):
3332

3433

3534
if __name__ == '__main__':
36-
unittest.main()
35+
unittest.main()

0 commit comments

Comments
 (0)