Commit 186c05a
committed
fix: correct tests for
Corrects the test so that they respect locales with Daylight Savings Time.
Previously, tests and suggested implementation simply did simple time arithmetic based on the offset
provided to `createAppointment`. This is wrong, as it will shift appointment time-of-day when moving
accross DST boundaries. This changes test implementation so that:
1. correct usage of input times is checked, by passing a 0 offset
2. correct offsetting of appointment time is checked, by passing in a known start date and then
creating one appointment that is within the same DST state and one that is not.
re: https://forum.exercism.org/t/tests-and-suggested-implementation-for-appointment-time-are-wrong/createAppointment
1 parent 709a441 commit 186c05a
File tree
1 file changed
+21
-17
lines changed- exercises/concept/appointment-time
1 file changed
+21
-17
lines changedLines changed: 21 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 27 | + | |
| 28 | + | |
30 | 29 | | |
31 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | | - | |
35 | | - | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
0 commit comments