Skip to content

Commit eacf6c3

Browse files
author
Мето Трајковски
committed
Added a note about unit testing
1 parent 8d1e21d commit eacf6c3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Arrays/rotate_array.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,12 @@ def rotate_array_2(arr, k, right = True):
6565
j += 1
6666

6767
# add the previous element on this position
68+
curr, arr[idx] = arr[idx], curr
69+
'''same as
6870
temp = curr
6971
curr = arr[idx]
7072
arr[idx] = temp
73+
'''
7174

7275
i += 1
7376

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ print(name_of_solution_1(test_val))
8080
print(name_of_solution_2(test_val))
8181
```
8282

83+
*Note that here I'm using the **simplest** way of testing, printing the results using the [print](https://docs.python.org/3/library/functions.html#print) method. Why? Because I think that the bigger part of the users of this repo isn't familiar with [unit testing](https://en.wikipedia.org/wiki/Unit_testing) and I wanted this part to be intuitive. Btw, I'm strongly recommending to use some unit testing framework for this kind of testing. The Python Standard Library contains a **great** framework for unit testing called [unittest](https://docs.python.org/3/library/unittest.html), or you can install some third-party unit testing framework like [pytest](https://docs.pytest.org/en/latest/).*
8384

8485
### Categories
8586

0 commit comments

Comments
 (0)