forked from bcalou/tp-python-doomsday-rule
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-algorithm.py
More file actions
61 lines (41 loc) · 2.21 KB
/
test-algorithm.py
File metadata and controls
61 lines (41 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from doomsday.algorithm import get_day_for_date
if get_day_for_date("2021-01-31") != "Sunday":
print('\033[91m❌ Date for 2021-01-31 should be Sunday')
elif get_day_for_date("2021-02-20") != "Saturday":
print('\033[91m❌ Date for 2021-02-20 should be Saturday')
elif get_day_for_date("2021-03-10") != "Wednesday":
print('\033[91m❌ Date for 2021-03-10 should be Wednesday')
elif get_day_for_date("2021-04-10") != "Saturday":
print('\033[91m❌ Date for 2021-04-10 should be Saturday')
elif get_day_for_date("2021-05-10") != "Monday":
print('\033[91m❌ Date for 2021-05-10 should be Monday')
elif get_day_for_date("2021-06-10") != "Thursday":
print('\033[91m❌ Date for 2021-06-10 should be Thursday')
elif get_day_for_date("2021-07-10") != "Saturday":
print('\033[91m❌ Date for 2021-07-10 should be Saturday')
elif get_day_for_date("2021-08-10") != "Tuesday":
print('\033[91m❌ Date for 2021-08-10 should be Tuesday')
elif get_day_for_date("2021-09-10") != "Friday":
print('\033[91m❌ Date for 2021-09-10 should be Friday')
elif get_day_for_date("2021-10-10") != "Sunday":
print('\033[91m❌ Date for 2021-10-10 should be Sunday')
elif get_day_for_date("2021-11-10") != "Wednesday":
print('\033[91m❌ Date for 2021-11-10 should be Wednesday')
elif get_day_for_date("2021-12-10") != "Friday":
print('\033[91m❌ Date for 2021-12-10 should be Friday')
elif get_day_for_date("2000-01-10") != "Monday":
print('\033[91m❌ Date for 2000-01-10 should be Monday')
elif get_day_for_date("1900-01-10") != "Wednesday":
print('\033[91m❌ Date for 1900-01-10 should be Wednesday')
elif get_day_for_date("2000-02-29") != "Tuesday":
print('\033[91m❌ Date for 2000-02-29 should be Tuesday')
elif get_day_for_date("1900-02-28") != "Wednesday":
print('\033[91m❌ Date for 1900-02-28 should be Wednesday')
elif get_day_for_date("2159-01-10") != "Wednesday":
print('\033[91m❌ Date for 2159-01-10 should be Wednesday')
elif get_day_for_date("2259-01-10") != "Monday":
print('\033[91m❌ Date for 2259-01-10 should be Monday')
elif get_day_for_date("2359-01-10") != "Saturday":
print('\033[91m❌ Date for 2359-01-10 should be Saturday')
else:
print('\033[92m✓ OK')