Commit a5bd153
Fix faulty tests for
* fix: correct implementation of `createAppointment`
Makes the suggested implementation of `createAppointment` correctly handle appointment creations that
cross timezones - e.g. due to Daylight Savings Time.
re: https://forum.exercism.org/t/tests-and-suggested-implementation-for-appointment-time-are-wrong/
* fix: correct tests for `createAppointment`
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/
* docs: update hints
* chore: update contributors
* style: prettier
* docs: refer to instructions for going about getter method
Co-authored-by: Cool-Katt <[email protected]>
* docs: more concise hint about setters
Co-authored-by: Cool-Katt <[email protected]>
* Format all the things
---------
Co-authored-by: Cool-Katt <[email protected]>
Co-authored-by: Derk-Jan Karrenbeld <[email protected]>createAppointment (#2767)1 parent 79d0d12 commit a5bd153
File tree
5 files changed
+42
-21
lines changed- exercises/concept/appointment-time
- .docs
- .meta
5 files changed
+42
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | | - | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
Lines changed: 28 additions & 16 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 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | | - | |
35 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
36 | 49 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 50 | + | |
| 51 | + | |
40 | 52 | | |
41 | 53 | | |
42 | 54 | | |
| |||
0 commit comments