Skip to content

Commit dcacc95

Browse files
committed
Added float tests
1 parent 4e2fcaf commit dcacc95

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: physics/horizontal_projectile_motion.py

+6
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ def horizontal_distance(init_velocity: float, angle: float) -> float:
5959
91.77
6060
>>> horizontal_distance(100, 78)
6161
414.76
62+
>>> horizontal_distance(4.5, 5.5)
63+
0.39
6264
>>> horizontal_distance(-1, 20)
6365
Traceback (most recent call last):
6466
...
@@ -89,6 +91,8 @@ def max_height(init_velocity: float, angle: float) -> float:
8991
22.94
9092
>>> max_height(100, 78)
9193
487.82
94+
>>> max_height(4.5, 5.5)
95+
0.01
9296
>>> max_height("a", 20)
9397
Traceback (most recent call last):
9498
...
@@ -119,6 +123,8 @@ def total_time(init_velocity: float, angle: float) -> float:
119123
4.33
120124
>>> total_time(100, 78)
121125
19.95
126+
>>> total_time(4.5, 5.5)
127+
0.09
122128
>>> total_time(-10, 40)
123129
Traceback (most recent call last):
124130
...

0 commit comments

Comments
 (0)